Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- mysql_connect('sql2.cluster1.easy-hebergement.net', 'blindtestmice2', '**********') or die(mysql_error());
- mysql_select_db('blindtestmice2');
- $timestamp = time();
- $ip = $_SERVER["REMOTE_ADDR"];
- $retour = mysql_query("SELECT COUNT(*) AS nbre_entrees FROM online WHERE ip='".$ip."' ");
- $donnees = mysql_fetch_array($retour);
- if($donnees['nbre_entrees'] == 0) {
- mysql_query("INSERT INTO online VALUES('', '".$ip."', '".$timestamp."') ");
- } else {
- mysql_query("UPDATE online SET timestamp='".$timestamp."' WHERE ip='".$ip."' ");
- }
- $timestamp_5min = $timestamp - (60 * 5);
- mysql_query("DELETE FROM online WHERE timestamp < ".$timestamp_5min);
- mysql_close();
- ?>
- <script>
- window.setInterval(function(){
- document.location.reload();
- }, 20000);
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement