Jump to content

comments box at the end of each page.


KevHopwood

Recommended Posts

Hi people.

 

I'm creating a website that runs on php and mysql.

 

I have a list page which grabs all the info on mysql and displays the content. once clicking on one of these it brings up a single page which lists more info on that specific item.

 

what I want is to add a comments field(feedback / review or what ever you may wish to call it) underneath the info on the single page. The commenter does not need to be logged in but maybe use there facebook Id or something to stop spammers clogging up the page.

 

what is the best way to do this?

 

Will it be using another mysql field called review? or is there some other way of doing this?

 

please can someone point me in the right direction for a tutorial (youtube preferably)?

 

thanks for your help.

 

Kev.

Link to comment
https://forums.phpfreaks.com/topic/283112-comments-box-at-the-end-of-each-page/
Share on other sites

What have you tried so far?

 

basically you store all comments in the database. When adding the comment to the database save your pages id with it, eg

INSERT INTO comments SET page_id = $page_id,
                         posters_name = '$posters_name',
                         comment = '$comment'

When you display your page and want to show the comments for that page. You'd run this query

SELECT posters_name, comment FROM comments WHERE page_id = $page_id

To protect from spam you can add something like ReCapture to verify the person that is submitting the comment is a human and not some spambot. If you only want members signed into facebook to be able to post a comment you'll have to look into using the facebooks api

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.