Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with XML
#1
Hi,
I am using GetSimple and wish to add some functionality but cannot get my think head around some XML stuff.

I have an order form (to request some stuff from teh wbsite) and wish to save the data from the form into a XML file which will include several orders:

<orders>
<order>
<title>Mr</title>
<fname>Fred</fname>
<lname> etc.....
</order>
<order>
...
</order>
<order>
...
</order>
</orders>


How do I read the existing file in to an xml tree, and then append a new <order> ... </order> node (with data supplied from the web form), and save the file?

I think this must be straightforward but extensive googling ahs notg turned up the correct place Sad

Any help here? Thanks in advance.
Reply
#2
The GS_Comments plugin does this sort of thing. Loads in the XML file with the current comments for a page, adds a new comment based on the form and saves it out again.

Shouldn't be too hard to lift the relevant bits of code out and change them to handle orders instead of comments.

My modified version is linked from the thread http://get-simple.info/forum/topic/1331/...scomments/
Reply




Users browsing this thread: 1 Guest(s)