winmastergames Posted June 13, 2008 Share Posted June 13, 2008 Well What would be the best way to make a website script that will come up with a timer that will show how long before the timer is finished (15mins) then keep counting then execute a PHP command (Below) and then when finished it will execute the command again after 15mins and over and over again... i also want to be able to put a Loading GIF that spins etc.. after Heres the script i want it to execute after 15mins: <? include("config.php"); ?> <?php mysql_connect($host, $username, $password or die("Error 103: MYSQL CONNECT"); mysql_select_db($name) or die("Error 103: MYSQL CONNECT"); # first get a mysql connection as per the FAQ $fcontents = file ('./207232386.ls1'); # expects the csv file to be in the same dir as this script $skip_first_n_lines = 6; for($i=$skip_first_n_lines; $i<sizeof($fcontents); $i++) { $line = trim($fcontents[$i]); $arr = explode("\t", $line); #if your data is comma separated # instead of tab separated, # change the '\t' above to ',' $sql = "insert into sslvl11hr values ('". implode("','", $arr) ."')"; mysql_query($sql); echo $sql ."<br>\n"; if(mysql_error()) { echo mysql_error() ."<br>\n"; } } ?> Thanks If you dont have time maybe you could just so me an example with the same kind of thing Link to comment https://forums.phpfreaks.com/topic/110035-solved-timer-then-run-command/ Share on other sites More sharing options...
RMcLeod Posted June 13, 2008 Share Posted June 13, 2008 Why do you want to do this via a web page? Would CRON not be suitable for what you are trying to do? Link to comment https://forums.phpfreaks.com/topic/110035-solved-timer-then-run-command/#findComment-564644 Share on other sites More sharing options...
winmastergames Posted June 13, 2008 Author Share Posted June 13, 2008 Well umm I gathered that CRON is only on Linux Maybe im wrong Never used CRON before by the way my web server is on Windows Link to comment https://forums.phpfreaks.com/topic/110035-solved-timer-then-run-command/#findComment-564665 Share on other sites More sharing options...
RMcLeod Posted June 13, 2008 Share Posted June 13, 2008 Windows doesn't have cron as such, but there are plenty of options available. Just google 'Windows Cron' I'm sure you'll find what you are looking for. Link to comment https://forums.phpfreaks.com/topic/110035-solved-timer-then-run-command/#findComment-564667 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.