View Full Version : Javascript contest help!

09-05-2011, 10:36 PM

I am trying to create a contest using javascript where people can enter a code that they receive at an event. Only so many of the codes are winners. The winners are directed towards a page where they can enter in their contact information, the others are directed towards a page that says thank you try again.

Can anyone help?

Philip M
09-05-2011, 10:42 PM
This is hopelessly insecure - like a Javascript password. The problem is that anyone can see the winning codes (those which redirect to a page where the user enters his contact information) simply with View Source.

You need to use server-side scripting here unless you want a surprisingly high number of winners! :)

It is your responsibility to die() if necessary….. - PHP Manual