Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-01-2007, 12:40 AM   PM User | #1
greglt
New to the CF scene

 
Join Date: Aug 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
greglt is an unknown quantity at this point
Promotional Code Protection

Hi,

New to this forum so please go easy on me. I have a problem and not sure if this is the right forum to post on but here goes.

I have been given a promotional code for a website and I want this to be protected so that only people who have paid for this code can use it. Is there anyway this can be done ? Obviously there are sights across the net where codes are just pasted left, right and centre and it is vital that this only goes to people who have purchased it.

1) The user logs onto the site
2) The user sees a offer he wishes ie.10% off Amazon.
3) The user purchases this offer and recieves the promo code which he can then enter at the checkout.

The problem is he could paste this on any forum.

ALSO....I want this code to be only useable once.

PLEASE HELP !!
greglt is offline   Reply With Quote
Old 08-01-2007, 01:37 AM   PM User | #2
timgolding
Senior Coder

 
timgolding's Avatar
 
Join Date: Aug 2006
Location: Southampton
Posts: 1,460
Thanks: 89
Thanked 110 Times in 109 Posts
timgolding is on a distinguished road
usually stuff like this involves using a hash or some difficult to read string that when inputed to a box the user gains access to the content. Remember using longer character representations will decrease the chance of you being hacked. For instance using only numbers for all you codes would be bad

16273

Imagine that was a code issued and all your codes were 5 digit codes. Then someone could hack in in about 5 mins by going through the limit set of possible combinations, 99999 combinations infact. However if you used a 30 character string that could be any number or character then that would take a lot longer

4887367798068925478930000000000000000000000000+ combinations for me to go through. If you consider that it takes a few seconds to send to the request and wait for authorization i would have a few years to wait to iterate through that lot.

With regards to stopping users passing the codes around. Well then you just stop them being downloaded. Once a code has been used you declare it invalid all this is simple enough with php

You might want to assign a time to live to these auth codes
__________________
You can not say you know how to do something, until you can teach it to someone else.

Last edited by timgolding; 08-01-2007 at 01:39 AM..
timgolding is offline   Reply With Quote
Old 08-01-2007, 03:47 AM   PM User | #3
whizard
Senior Coder

 
whizard's Avatar
 
Join Date: Jan 2005
Location: Philadelphia, PA, USA
Posts: 1,457
Thanks: 10
Thanked 37 Times in 37 Posts
whizard will become famous soon enoughwhizard will become famous soon enough
You could email the user the codes, so that it was private. Then, as Tim said, you could disable the code after it was used pretty easily.

HTH
Dan
__________________
If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.
Step 1: Learn. Step 2: Search. Step 3: Post here.

Last edited by whizard; 08-02-2007 at 04:02 AM..
whizard is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:51 PM.


Advertisement
Log in to turn off these ads.