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 4 of 4
  1. #1
    New Coder
    Join Date
    Feb 2008
    Posts
    47
    Thanks
    13
    Thanked 1 Time in 1 Post

    unique download key

    I'll be selling a record, and inside each record I intend to put a unique download key, that enables the buyer to go to my website, enter the download key, and recieve a link to some mp3 files.

    I'm wondering how easy this would be to set up and what would be best to use?.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,866
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Generate a random string(alphanumeric) with a suitable length(should be non guessable) and store it in DB. When some one enter a key, compare this with all values in DB. If matched, allow him to proceed and mark this key as used. Else show "Invalid key".
    If some one enter a used key, show a message "Invalid/ already used".
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    Feb 2008
    Posts
    47
    Thanks
    13
    Thanked 1 Time in 1 Post
    thanks, what would I use to generate the string, I'd need 200 unique codes. would I use a form to talk to the database?

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,866
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    With some simple serverside script, here is one in PHP,
    http://www.codewalkers.com/c/a/User-...key-generator/
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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