Quote:
|
Originally Posted by Oras
Sure you can do this by making a simple file and put a counter on it, and do a cron job to set the counter value to zero at the begining of each day.
|
Clever! Very clever! I love the simplicity. However, I don't recommend using flat-text files because you have to deal with locking to atomically increment the number inside. Instead, you can have a cronjob set a field in a database to 0.
Quote:
|
Originally Posted by Oras
Or make a table in DB (id,counter,date)
|
This is a good solution, but requires a little extra logic for the first signup of the day. Also, the id field isn't needed, as you can use the date field as the primary key.
Quote:
|
Originally Posted by Xenatino
Implement a script into your subscription page that checks when the last update occured. If it was more than 24 hours ago, reset the counter and update the lastupdate field with an UNIX timestamp.
|
If at least one person subscribes every 24 hours, the counter would never reset.
Quote:
|
Originally Posted by Unknown01
or you can do the easyest and probly most effiecent way and uses sessions. everytime somone finishes a sign up ...
|
Aren't sessions tied to a specific visitor? In that case, every visitor would have their own counter, so this wouldn't work either.