PHP Script for (Leave a comment)

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
theboxinghistorian
Forum Newbie
Posts: 4
Joined: Sat Jan 02, 2010 9:03 am

PHP Script for (Leave a comment)

Post 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.
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: PHP Script for (Leave a comment)

Post by AbraCadaver »

You need to save the comment somewhere and then retrieve it. You can try a database or a text file.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
theboxinghistorian
Forum Newbie
Posts: 4
Joined: Sat Jan 02, 2010 9:03 am

Re: PHP Script for (Leave a comment)

Post 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"
User avatar
omniuni
Forum Regular
Posts: 738
Joined: Tue Jul 15, 2008 10:50 pm
Location: Carolina, USA

Re: PHP Script for (Leave a comment)

Post 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.
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Re: PHP Script for (Leave a comment)

Post by daedalus__ »

i dont see any links
Post Reply