I'm trying to come up with a way for users to have a 30-day pass to some images on my site, but am having a hard time thinking of how to do it. I already know how to put images in a database and retrieve them, but can't figure out how to tell if their 30 days is up. I know the date() function won't work... what will?
My ongoing projects...
www.naturesmagazine.com
www.energyreform.org *new domain*
www.photographyavenue.com
----
You may also remember me as imnewtophp...
Comments
What you'd need to do is create a cookie on the users system which holds the date that they first accessed the image.
In your script, you could then pull up this cookie and compare it with the current date information, meaning you could work out how long it's been before they first accessed the script that shows the image.
The problem here is that cookies aren't perfect and can be deleted and toyed with.
If the cookie is deleted, the user is basically granted an entirely new 30 day access period.
You could store some data in a database to tell the script when that user first accessed the script with a cookie containing the user I.D., though you'd have to remove the data from the database whenever the user requests a new 30 day access period, meaning there's more work envolved.
Current project: CMS Object.
Most recent change: Theme support is up and running... So long as I use my theme resource loaders instead of that in the Rails plug-in.
Release date: NEVER!!!
- xPureNLx
Sessions are destroyed when you log off.
Current project: CMS Object.
Most recent change: Theme support is up and running... So long as I use my theme resource loaders instead of that in the Rails plug-in.
Release date: NEVER!!!