if statement - PHP only runs if I reload page -
i have if statement that'll run when reload page. here's code:
if ($date == date('00:00:00') && (isset($postchecktoday))){ // code goes here }
the if statement within function runs constantly. when hits 00:00:00, have reload page dead-on time if statement runs. want if statement run without having reload page @ 00:00:00.
the whole point of running precisely @ 00:00:00 runs if statement once every 24 hours.
is there alternative way of doing using strictly php? use cron wouldn't execute whole php file once day? @ moment have function that's running code, , if statement within function runs @ 00:00:00. unless cron able directly call if statement php file, i'm unsure if use me.
if need keep seperate, create php script , use cron execute once day, @ hour 0, minute 0, second 0.
reference this
Comments
Post a Comment