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.
PHP Script for (Leave a comment)
Moderator: General Moderators
-
theboxinghistorian
- Forum Newbie
- Posts: 4
- Joined: Sat Jan 02, 2010 9:03 am
- 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)
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)
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)
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.
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.
- daedalus__
- DevNet Resident
- Posts: 1925
- Joined: Thu Feb 09, 2006 4:52 pm
Re: PHP Script for (Leave a comment)
i dont see any links