Update XML Data with PHP code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LacrosseB0ss
    New Member
    • Oct 2006
    • 112

    Update XML Data with PHP code

    Hey community;

    What I would like to do is open an XML document and change whatever is in a given node using PHP. I have read some stuff on DOM but can't really figure it out. As well in the past all I've used is simplexml_file_ load() to work with XML files.

    I was trying ->asXML() and ->asXML($path) but they overwrote the entire file. Is there a better way to do this? Basically what is to happen is a user is trying to change their password. So the login information is saved in an XML file. The user enters their new password in a textbox and hits "Change My Password". Then, the code will look through the list of users until the logged in user is found and changes the password in the XML file to whatever the user provides.

    Any insight into what I'm doing wrong OR the best way to do this right would be greatly appreciated. Thanks!

    - LB
Working...