dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Discount code

  1. #1
    Join Date
    Aug 2010
    Posts
    34

    Discount code

    Hi there, I need help with a discount code/promo text area.

    On a page I have an input text box called "promo"

    I want the user to enter a code and this will then give the user a discount on their order.

    For now I jsut want to check whether the code matches the stored code.

    This will all be client side. I imagine the code will have to encrypted/decrpted.

    so the journey is:


    user puts in code : hello

    the javscript takes 'hello' and checks it agains the stored discount code which is goodbye.

    as they do not match a msg appears saying sorry incoreect promo code.

    IF the user enters goodbye as their promo code the JS knows is is correct and displays a msg saying thank you promo code correct.

    What is the best way fo going about this?


    Thanks

  2. #2
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Quote Originally Posted by amean_n View Post
    What is the best way fo going about this?
    I would opt for a server-side solution, not a JavaScript one. As JavaScript is a client-side language, it is not suitable for handling sensitive data, as passwords, codes, private/secret issues. Could be a code based on PHP, for instance, if your sever accept that language.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles