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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.