Guest User

Untitled

a guest
Aug 14th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. This is the javascript on the customer edit page that is supposed to call the php script:
  2.  
  3.  
  4. <script language="javascript">
  5.  
  6. function delayer(){
  7. window.location = './checktime.php?ID=<?PHP echo $ID;?>',
  8. }
  9.  
  10. </script>
  11.  
  12.  
  13.  
  14. This is the interval tag setup in that same page:
  15.  
  16. <body id="main_body" onLoad="setInterval (delayer(), 5 )">
  17.  
  18.  
  19.  
  20. This is the page that updates the timestamp in the SQL record:
  21.  
  22.  
  23.  
  24. <?PHP
  25. require_once('db.inc.php');
  26.  
  27. $timestamp=date("Y-m-d H:i:s", time());
  28.  
  29. $ID = $_GET['ID'];
  30. // $ID = '1041';
  31. $query = "UPDATE customer set uptime = '$timestamp' where ID = '$ID'";
  32.  
  33. // echo $query;
  34. mysql_query($query);
  35.  
  36.  
  37. ?>
Add Comment
Please, Sign In to add comment