Log in

View Full Version : Flat-file comment posting with XML



Spinethetic
08-15-2010, 08:20 PM
I am creating a landing page for visitors and what I'am trying to setup is something like comment functionality as can be found on any typical WordPress blog.

Because I create several different different landing pages every month, the reason I just want it real simple flat-file is so that I have more free time that is not spent on database creation ec etc.

I can make a 777permission txt file and have people can add entries (name, website, comment) and just run a foreach loop through and display each entry so far, but I wan to have the entries written and stores into an XML file like so..


<comment>
<name>John Smith</name>
<website>http://johnsmith.com</website>
<date>7/23/2010</date>
<comment>Hey but what about the blah blah blah</comment>
</comment>


But I am not very familiar with working with reading and writing to XML formated files. Thank you for any help or direction :)

traq
08-15-2010, 10:32 PM
Look into php's simpleXML (http://us2.php.net/manual/en/book.simplexml.php) extension. I've built an XML comment script like this before.

In the long run, however, it's not "simpler" to build this with XML vs. a database - especially if it's a more-or-less permanent feature. And it won't be as fully-featured, either: basically comment-and-forget-it.

Spinethetic
08-16-2010, 01:24 AM
Look into php's simpleXML (http://us2.php.net/manual/en/book.simplexml.php) extension. I've built an XML comment script like this before.

In the long run, however, it's not "simpler" to build this with XML vs. a database - especially if it's a more-or-less permanent feature. And it won't be as fully-featured, either: basically comment-and-forget-it.

Thats all that I really want, no registration, just a good captcha to help block bots. Admitedly to my own demise I am very hands on when it comes to coding, I certainly see much to gain via using mysql and I do use it for a WP blog and another site I own. I would prefer a flat-file system for this landing page though. I will check around HotScripts or resourceindex later tonight to see if I can just download a full script because I have a deadline with many other things to do for this project. Thank you for the simpleXML tip, if I ever get some free time I will be checking that out and some example scripts out there.

traq
08-16-2010, 03:19 AM
no problem.


Thats all that I really want, no registration, just a good captcha to help block bots.
[...]
I have a deadline with many other things to do for this project...

If you end up looking for paid help, I could add a captcha to my comment script for you. Some basic administrative functions could be an option, too. Let me know (http://www.custom-anything.com/contact) if you're interested.

good luck!