Hello guys,
I have a countdown that is counting from 24:00:00 to obviously 00:00:00. I need it to run a specific php file once it gets to zero. Anyone knows how may I accomplish this? I suppose it's pretty easy but I don't have an idea right now.
About the countdown start time - it's been stored in Mysql as date time, but it could be also stored as timestamp if that would make it possible to happen.
Thanks a lot,
Toni
PHP Countdown
Moderator: General Moderators
Re: PHP Countdown
you could store the countdown timestamp into a variable and then set an if function for when that variable is = to 00:00:00
Re: PHP Countdown
Yeah but that means the script would run when someone visits that page. What if there's noone online?fugix wrote:you could store the countdown timestamp into a variable and then set an if function for when that variable is = to 00:00:00
-
ayazhaider
- Forum Newbie
- Posts: 5
- Joined: Fri Apr 22, 2011 11:18 am
Re: PHP Countdown
yes, and that visitor view the webpage you want to show after the countdown reached 00:00:00 ...
what do u want to do ??
what do u want to do ??
Re: PHP Countdown
Once the countdown has reached 00:00:00, I want to run file "update.php" which generates number between 1 and 100 and then use that $generated_number in query like "UPDATE users SET premium='1' WHERE user_id='$generated_number'"ayazhaider wrote:yes, and that visitor view the webpage you want to show after the countdown reached 00:00:00 ...
what do u want to do ??
Hope I was more clear now.
Re: PHP Countdown
Any reason you're not just running this from cron?
Re: PHP Countdown
Because I can't predict the time countdown will start and that way I don't know when will it end. Start of the countdown is dynamical also.Celauran wrote:Any reason you're not just running this from cron?