Page 1 of 1

PHP Script for (Leave a comment)

Posted: Sat Jan 02, 2010 9:09 am
by theboxinghistorian
A while back I created a contact page and the PHP script I created forwarded the message to my Email address. Now I am looking for the message to appear on the same page, I have many articles at my website and I want to offer the visitor the opportunity to leave a comment on the story they have just read (you may have seen this feature before). I have set up a test page @ http://www.theboxinghistorian.com/test.html as you will see the page is there but I do not know how to get the comment posted to appear on the page.

Any help would be greatly appreciated.

Re: PHP Script for (Leave a comment)

Posted: Sat Jan 02, 2010 1:45 pm
by AbraCadaver
You need to save the comment somewhere and then retrieve it. You can try a database or a text file.

Re: PHP Script for (Leave a comment)

Posted: Sat Jan 02, 2010 2:04 pm
by theboxinghistorian
Thanks for the Information but there is like hundreds of links there. As I am kind of knew to this I do not know where to start I cant see any link reffering to "Leave a comment"

Re: PHP Script for (Leave a comment)

Posted: Sat Jan 02, 2010 10:11 pm
by omniuni
OK, how is the information currently stored? Hopefully, each article has an ID.

In your database, you need a table.

The table should include columns for:
KEY, ArticleID, DisplayName, Message

When a user submits a form, have it post to the same page, and have the page check if the form has, in fact, been posted. If so, write it into the database. Now, you have the information needed to query the database for the comments related to each article.

Re: PHP Script for (Leave a comment)

Posted: Sun Jan 03, 2010 12:20 am
by daedalus__
i dont see any links