I am very new to PHP and the first project is to create a simple news system/guestbook. I use a xml-file to store the data, the parsing thing is done but how do I write correctly to the xmlfile?
I use fopen to open the file, fseek to go to the correct postion and then I use fwrite... but thas does not work. I want to add every new entry before the last, like this:
<?xml version="1.0"?>
<guestbook>
/fseek to this position
and add new/
<entry>
..new entry
</entry>
<entry>
...old entry
</entry>
...but fwrite always overwrite the file. So how can I simply add it to the file and have the other enrtyes move back (if you know what I mean).
Thanx