View Full Version : update xml file from html form

09-10-2005, 02:21 PM
First off I am fairly new to XML. I have read a few tutorials on it, it's syntax etc.. but have yet to define a xml document.

My query is, is it possible to take from a html form that a user would submit to a php script, and for this submitted data to go into a xml file (say messages.xml) ?

I know this could be done using sql or similar but am keen to see if it can be done using XML through PHP.

If it can be inserted into a xml file, can messages.xml also be viewed (so that you can see the user submitted values?

Thanks a lot in advance.

09-10-2005, 04:58 PM
your xml-file is just a regular textfile, and you can edit it just like any textfile.
or you can read in the xml-file, parse it and store it in an array and then edit the array and finally recreate the xml-file from the array. (or turn it into html and print it on screen).
If your application will only be viewed in IE, then you can use your xml-file as an external data-island and show/filter/sort/edit it inside the browser.

but it would make a lott more sense to store your data in a db and then generate the xml file when you need it.

09-10-2005, 04:59 PM
Right. I thought the database would be the best option for showing/editing purposes.