What are some code examples that I can use to stop people from casting votes to give them a higher rating by hacking the php script?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The first line of defense is a cookie.
Basically, you set the cookie on their machine, and disable voting if it is present.
This gets rid of a database call you might need to make in order to validate their voting. It is a good idea to keep this in place, because it is like caching: the fewers hits to the database the better.
The second line of defense is IP limiting. You basically would check for a IP address log in your database, and see if they voted recently.
Turning your entire script into something along the lines of
You’ll also have to add in the expiration times and such, but the basic jist of it is there.