I am trying to create a script that will keep checking the time and if it's the desired time lets say 17:01 o'clock, it will commit the action. Once it's not that time, the scripts stop and goes back to checking the time. Please set me on the right path because my script:
PHP Code:
<?php
// Ignore user aborts and allow the script
// to run forever
ignore_user_abort(true);
set_time_limit(0);
$i=5;
$time=date("Gi");
while($i==5){
if ($time=="1701") {
$myFile = 'users/Guy/test.txt';
$fh = fopen($myFile, 'w') or die("<div class='errorbox' id='errorbox'>Oops! Something happened!</div>");
$stringData = "Awesome\n";
fwrite($fh, $stringData);
$stringData = date("l")." @ ".date("g").":".date("i").":".date("s")."\n";
fwrite($fh, $stringData);
$stringData = $_SESSION['username'];
fwrite($fh, $stringData);
fclose($fh);
}
}
?>
And it doesn't seem to do that. I would rather not use cron jobs if that's possible!
Thanks!
Bookmarks