Home » questions » PHP time function - how can i count link hits in preset period of time?
PHP time function - how can i count link hits in preset period of time?
I have a website and want to make some top-list over popular links(how many times they have been used )
Like:
Top-10 links this week
Top-10 links this month
I belive it must be something like this
If ($_GET someURL)
{add 1 to count colum in database}
But then there is the time problem. Eg. i want the colum in the DB to be set to 0 (nill) every time 7 days have pased.
So... how does the time function in PHP work, can someone give me a code that would set a database colum to 0(nill) eg. every 7 days or every monday ?
Do i need to update "date" in database every time someone uses a link, or is the date only inserted into the DB the first time the link is but into the DB ?
Thanks for the answers guys.... they did but me in the right direction, but i had to go to a forum for webmasters to get the details i needed. - http://www.webmaster-talk.com/

Answers
msabramo
On 2006-08-04 16:27:03
Pachu
On 2006-08-11 06:05:05