Page 1 of 1

creating an xml file using php

Posted: Sat Jun 17, 2006 3:29 am
by itsmani1
I want to create an xml using php and i want to save hashed password in it, Please tell me simplest way to do so.

Fatal error: Call to undefined function new_xmldoc() in c:\wamp\www\test\z1.php on line 2
aboved mentioned error happend with i used this code for xml file creation.

Code: Select all

<?
$doc = new_xmldoc('1.0');
$root = $doc->add_root('members');
$member = $root->new_child('member','');

$member->new_child('lastName','John');
$member->new_child('firstName','Adams');
$member->new_child('contribution','3400');

$member = $root->new_child('member','');

$member->new_child('lastName','Debra');
$member->new_child('firstName','Hones');
$member->new_child('contribution','2400');

$member = $root->new_child('member','');

$member->new_child('lastName','Jake');
$member->new_child('firstName','Tudor');
$member->new_child('contribution','1200');

$fp = @fopen('members.xml','w');
if(!$fp) {
    die('Error cannot create XML file');
}
fwrite($fp,$doc->dumpmem());
fclose($fp);
?>


Thanks.

Posted: Sat Jun 17, 2006 9:03 am
by kendall
I dunno its seems that you are trying to access a function that isnt there man... It looks like a custom class or the PHP 5 you shud check wit your admin host guys and find out about your PHP versions...if not check your includes and where ever that class construct is