Get tips on XML - (X)html - CSS and php

XML as a database

home

Saving comments in a XML file

Here comes the article

Here i'll try to leave my progress in using an xml file as a database.
As a first experiment i have saved comments (you can make below this page) in an XML file and using this file for displaying the comments.
This is fairly easy, the only catch was to get a new comment in front of the closing comments tag (</comments>).
The file function solved this problem.
This simple script can be used for a simple guestbook, photogallery or whatever.
Check the two files xml-comments.php and insert_xml.php.

The next step will be in keeping different articles with their comments in one XML file and be abble to do searches in this file

See the XML file for this page: Comments1.xml

Leave a comment:

Comments:

On 06/10/97 My test Nick wrote:

test title 1
test desc 1

On 07/10/97 Ricardo wrote:

test 2
testing.....

On 08/10/97 Beatriz wrote:

Beatriz maakt een testje
enz...

On 03.27.06 Me wrote:

date added
added a date field so we can see when the comment is posted. I added the date as an attribute to the comment tag.

On 03.30.06 Me wrote:

The attribute
I\'m going to play a bit with the attributes.

On 04.04.06 test wrote:

test
test

Valid XHTML 1.1 and CSS