Jump to content

[SOLVED] Timer Then Run Command


winmastergames

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.