Welcome Guest, Not a member yet? Register   Sign In
Assign promocode, but only if cookies are accepted
#1

[eluser]mvdg27[/eluser]
Hi guys,

I'm struggling with the following situation:

I want to assign promocodes to visitors of my website. I have a list of 5000 valid codes and each code can be used only once.

Each visitor should be getting only one code, and this should be saved in a cookie. My initial idea is to get a valid, unused code from the database on a users first page request and then save the code in a cookie. Upon assignment the code is marked as assigned. On each following page request (not necessarily in the same session), the script checks for the existence of a cookie, and if it exists doesn't assign a new code.

Seems all good, except in the case a user doesn't accept cookies, and thus get's assigned a new promocode upon each request and using up all the codes.

Basically it's fine to notify the user that cookies are required to receive a promocode.

Any ideas on how to solve this issue?

Thanks, Michiel

PS. I'm fully aware that the cookie solution in itself is not the best option anyway, but I'm not dealing with a high risk operation here. Basically looking for a quick and dirty solution for a temporary website.


Messages In This Thread
Assign promocode, but only if cookies are accepted - by El Forum - 01-19-2010, 08:40 AM
Assign promocode, but only if cookies are accepted - by El Forum - 01-19-2010, 09:03 AM
Assign promocode, but only if cookies are accepted - by El Forum - 01-19-2010, 09:08 AM
Assign promocode, but only if cookies are accepted - by El Forum - 01-19-2010, 09:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB