"Was this helpful" script

Hey guys,

I’d like to have a “was this helpful” script on my review site, so people can say whether they find a review helpful. I know this is going to require a mix of AJAX and php but I’m a JS newbie and was hoping someone knows of pre-made script I could use for this. Anyone know of one?

Thanks,

Chris

I’ve never done this before however, if I were going to attempt it, I would only use AJAX and PHP.

I think you would have to have a ‘was this helpful’ link that calls an ajax function. The ajax function would go to a php page that would basically update a database each time someone clicked helpful.

If you had 2 choices (helpful or not helpful) you would have 2 columns and when displaying the result you could see which was greater of the 2 and display that as the result

ex:


Col 1 (helpful)         Col 2 (Not Helpful)

      55                             20

Here you would use a php script to compare the 2 numbers and, as helpful is greater than not, display ‘users thought this was helpful’

Anyway, hopefully that’s what you were asking. I don’t think javascript would have much role other than calling the XMLHTTPrequest object for the ajax call.

Thanks sd_js, very helpful. Yes, I think I’m just going to have to write this myself, no big deal.