Closed Thread Icon

Topic awaiting preservation: PHP help adding stuff to an XML document. (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=24608" title="Pages that link to Topic awaiting preservation: PHP help adding stuff to an XML document. (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: PHP help adding stuff to an XML document. <span class="small">(Page 1 of 1)</span>\

 
ub3r_n00b
Neurotic (0) Inmate
Newly admitted

From:
Insane since: Jan 2005

posted posted 01-07-2005 04:43

Ok - I am a n00b to PHP but i honestly can not understand why this wont work. It may be because I have an older version of PHP or something but if you go to www.erudianart.com/05/PHPtest/test.php , the source code looks like this.

code:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>ErudianArt v0.010205 || PHP test</title>
</head>
<body>

<?php

$doc = domxml_open_file("test.xml");
$node = $doc->create_element("para");
$node->set_attribute("align", "left");
$newnode = $doc->append_child($node);


?>

</body>
</html>



Ive even tried this with... millions of other combinations and such and I can not get my XML file to change!! arg.. can anybody help me, I am just looking for a way to make stuff in PHP add to my XML files.

the xml file is test.xml in the same directory.

Thanks!

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 01-07-2005 05:00

Well you're not doing anything with your new document. This just stores the xml in memory you need to dump the file for any changes to stick.



.:[ Never resist a perfect moment ]:.

ub3r_n00b
Obsessive-Compulsive (I) Inmate

From:
Insane since: Jan 2005

posted posted 01-07-2005 06:06

eggggcelent. Thanks very much. And this is why I am a n00000000000b.

-Preet

« BackwardsOnwards »

Show Forum Drop Down Menu