Hi All The matter is that I have a counter at my site, stores the values at a text file, and I want to reset this counter automatically to zero every day at a specified time, lets say at 6 pm, so any body have ideas how to do that? Regards
Well the only way to do it at exactly a specified time is to use a cron job on the server to run a php file. The other thing you could do is kind of fake it and check everytime a page is loaded and see if it is past 6pm and if it has been set to 0 or not for that day.
The second one is not good because it is static in way or another. About the first one, I haven't heared about it, you mean I need to contact the server administrator to do this for me?!! or I couldn't get it yet?
If you have a cpanel look for Cron Jobs [CTRL+F to find the text is easiest] Basically google cron jobs for a tutorial but they look like this: * * * * * * * phpbin myfiletoexecute.php the *'s represent when you want the cron job to fire, *'s mean everytime, so this would fire every second of every day. You can put a 0 in the second column and a 30 in the minute column to make it fire once every 30mins and so forth. As i said google cron jobs there are many tutorials
cron is the unix solution for running scheduled tasks (in short - run a program at a specified time). easiest solution for you if you're not familiar with these concepts is to contact your host... first question is what operating system is your site hosted on?