K
Kevin212
Guest
How can a give an URL that points to a JPG to multiple people, and the URL only works one time for each person?
Details:
I want to include an URL in an automated email message (send to multiple users with e-commerce), and include in that email a link to an image of a coupon. The link should only work once (and they will be told that in the email)
The desired result is that the user clicks the link, they see the coupon in their browser, then they can print it. If they ever click that URL again, they get a message saying that they have already accessed that coupon.
The hosting setup I have to solve this against is Unix / Apache. PHP / MySql. Which I know nothing about (my background is MS IIS / ASP/ .NET, etc...)
I'm thinking that I will have to give each user a unique ID (i.e. a number) and e-commerce reads that out of my CSV file when generating the mail-merge type emails. In the body of each email is a link with a query string like:
http://www.domain.com/checker.php?ID=12345
when the page "checker.php" gets that query string, it checks a MySql database for the ID "12345", if it does not see that ID, it shows the JPG file in the browser, and then updates the database with that ID, essentially saying "ID # 12345 has accessed this page"
If the user ever clicks the url again, then the page checks the database, see's the ID in there flagged as "has seen the page" and shows them a different page that states "You have accessed this url already.."
This is what I figure it would take. Does anyone have any suggestions on if this is possible?, do I have to do it the way I described? or, is there a better / simpler / more elegant what to do this?
Thanks!
Details:
I want to include an URL in an automated email message (send to multiple users with e-commerce), and include in that email a link to an image of a coupon. The link should only work once (and they will be told that in the email)
The desired result is that the user clicks the link, they see the coupon in their browser, then they can print it. If they ever click that URL again, they get a message saying that they have already accessed that coupon.
The hosting setup I have to solve this against is Unix / Apache. PHP / MySql. Which I know nothing about (my background is MS IIS / ASP/ .NET, etc...)
I'm thinking that I will have to give each user a unique ID (i.e. a number) and e-commerce reads that out of my CSV file when generating the mail-merge type emails. In the body of each email is a link with a query string like:
http://www.domain.com/checker.php?ID=12345
when the page "checker.php" gets that query string, it checks a MySql database for the ID "12345", if it does not see that ID, it shows the JPG file in the browser, and then updates the database with that ID, essentially saying "ID # 12345 has accessed this page"
If the user ever clicks the url again, then the page checks the database, see's the ID in there flagged as "has seen the page" and shows them a different page that states "You have accessed this url already.."
This is what I figure it would take. Does anyone have any suggestions on if this is possible?, do I have to do it the way I described? or, is there a better / simpler / more elegant what to do this?
Thanks!