# Trying to make a php form to edit xml

**URL:** <https://forum.kirupa.com/t/trying-to-make-a-php-form-to-edit-xml/332666>\
**Category:** Uncategorized\
**Created:** [September 17, 2014, 2:06am UTC](https://forum.kirupa.com/t/trying-to-make-a-php-form-to-edit-xml/332666 "2014-09-17T02:06:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joshua\_Rundle](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@Joshua\_Rundle](https://forum.kirupa.com/u/Joshua_Rundle)\
**Post date:** [September 17, 2014, 2:06am UTC](https://forum.kirupa.com/t/trying-to-make-a-php-form-to-edit-xml/332666/1 "2014-09-17T02:06:09Z")

</div>

I have been searching hi and low for a clear example of how to achieve what I want. I have an xml configuration file I need to allow users to only change 2 values in it.  
\<CONFIG application=“SAM” version=“3.4.2”\>  
\<Database\>  
\<Driver\>MYSQL\</Driver\>  
\<Host\>CHANGETHIS\</Host\>  
\<Port\>3306\</Port\>  
\<Database\>SAMDB2\</Database\>  
\<Username\>root\</Username\>  
\<Password\>CHANGETHIS\</Password\>  
\</Database\>  
\</CONFIG\>  
the \<Host\> and \<Password\> values are all I want to have edited.

I know I can do this with simplexml but I never did much along the lines of web apps. I have other xml’s to edit as well but if I can get a clear example of how to read this file in and modify the 2 specified values then re-write the file then I would have a good understand to get out there and make this work. I am writing a plugin slowly for wordpress to interface with an internet radio station program. If someone can give me a good start or example preferably with code comments that would be awesome. TIA
