Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript contest help!

    Hi!

    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?

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,310
    Thanks
    203
    Thanked 2,563 Times in 2,541 Posts
    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

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •