simple xml update from php form
basically i have a little client list on a wiki that reads data from an xml file called db_staffList.xml eg:
and i am using xmlParser.php to do this and to display the results on a wiki page.
<mobile>0420 111 222</mobile>
That's all working a-ok, but i would like a non coding person to be able to update the db_staffList.xml with new items.
to do this i would like to make a simple php form page that posts a new staff member into the xml file. All thats needed is 5 inputs and a submit btn eg:
can someone guide/help me in doing this – im still very new to php. Validation isnt really required for the time being – that can be phase 3.
<form name="input" action="insert.php" method="post">
<p>Insert new client:</p>
<input type="text" name="name" />
<input type="text" name="mobile" />
<input type="text" name="extension" />
<input type="text" name="title" />
<input type="text" name="email" />
<input type="submit" value="send" />
Re: - simple xml update from php form
You can use to the file() function of PHP, which is for handling files. You can use this function to amend new data to the XML file.
One thing that you will have to do will be i.e. the XML file should be given 777 permission so that it can be written by the PHP script.
Hope this helps!
LeXolution IT Services
Web Design Company