ok, i have code so that a user can only view a page once a day.
the page will only display if the session variable is not set, then it will set the variable, so ti cant be seen again, OK?
the thing is, how do i get it so at midnight the user can then view the page again that day?
then once the next day, and once the next day, and so on...
end a sesssion? huh... im so stuck..
Moderator: General Moderators
Expanding on what Gen-ik said:
I guess you could set a cookie that automatically sets the expiration time for midnight that day? Problem with cookies is that they can be changed or possibly not even set on the client's computer.
Another way you could do it would be so that everytime a user views that page, before it is shown the database is queried to see if they have already seen it. If they are not in the database, let them see it and if they are then stop the loading of the page. Then add the user to the database if they view the page.
I guess you could set a cookie that automatically sets the expiration time for midnight that day? Problem with cookies is that they can be changed or possibly not even set on the client's computer.
Another way you could do it would be so that everytime a user views that page, before it is shown the database is queried to see if they have already seen it. If they are not in the database, let them see it and if they are then stop the loading of the page. Then add the user to the database if they view the page.