Connecting Tech Pros Worldwide Help | Site Map

problem with xml file creation.

dizyn's Avatar
Newbie
 
Join Date: Jun 2006
Posts: 9
#1: Jun 17 '06
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.


Quote:
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.

Expand|Select|Wrap|Line Numbers
  1. <?
  2. $doc = new_xmldoc('1.0');
  3. $root = $doc->add_root('members');
  4. $member = $root->new_child('member','');
  5.  
  6. $member->new_child('lastName','John');
  7. $member->new_child('firstName','Adams');
  8. $member->new_child('contribution','3400');
  9.  
  10. $member = $root->new_child('member','');
  11.  
  12. $member->new_child('lastName','Debra');
  13. $member->new_child('firstName','Hones');
  14. $member->new_child('contribution','2400');
  15.  
  16. $member = $root->new_child('member','');
  17.  
  18. $member->new_child('lastName','Jake');
  19. $member->new_child('firstName','Tudor');
  20. $member->new_child('contribution','1200');
  21.  
  22. $fp = @fopen('members.xml','w');
  23. if(!$fp) {
  24.     die('Error cannot create XML file');
  25. }
  26. fwrite($fp,$doc->dumpmem());
  27. fclose($fp);
  28. ?>
Thanks.
Banfa's Avatar
AdministratorVoR
 
Join Date: Feb 2006
Location: South West UK
Posts: 6,148
#2: Jun 17 '06

re: problem with xml file creation.


Quote:

Originally Posted by dizyn

Expand|Select|Wrap|Line Numbers
  1. <?
  2. $doc = new_xmldoc('1.0');
  3. ...
  4. ?>

I think you might mean

Expand|Select|Wrap|Line Numbers
  1. <?
  2. $doc = new xmldoc('1.0');
  3. ...
  4. ?>
Reply