PDA

View Full Version : php form to add child in xml


chriskq
11-06-2008, 03:55 AM
Hey all,

basically i have a little client list on a wiki that reads data from an xml file called db_staffList.xml eg:

<staff>
<name><![CDATA[Adam Smith]]></name>
<mobile>0420 111 222</mobile>
<extension>4444</extension>
<title>Executive Pimper</title>
<email>adam.smith@company.com.au</email>
</staff>

and i am using xmlParser.php to do this and to display the results on a wiki page.

That's all working a-ok, but i would like a non coding person to be able to update the db_staffList.xml with a new user.

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:

<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" />
</form>

can someone guide/help me in doing this im trying to get back into php after becoming abit of a designer recently. Validation isnt really required for the time being that can be phase 3.

edbr
11-06-2008, 05:30 AM
not quite the same but i just did this xml file that collects date from mysql database then displays them. mine is being read as an rss feed . Any use ?

davidj
11-06-2008, 05:59 AM
just point your form to a script which writes xml

use php's many xml options to add to the xml file