I have the code below which works fine but I don't want to echo $time or $timestamp
But if i don't then the code does not work. Does any know a way of fixing this?
<?php
mysql_connect (localhost, user, pass);
mysql_select_db (table);
$newIP = $_SERVER['REMOTE_ADDR'];
$self = $_SERVER['PHP_SELF'];
$time = time();
$result = mysql_query ("SELECT * from counter where IP = '$newIP'");
$row = mysql_fetch_array($result);
$timestamp = $row["timestamp"];
$IP = $row["IP"];
echo $time;
echo $timstsamp;
echo $IP;
if ($timestamp >= time() - 600)
{
echo 'sorry';
exit();
} else {
$result2 = mysql_query ("INSERT INTO counter (`id`,`IP`,`page`,`timestamp`) Values ('','$newIP','$self','$time')") or die("INSERT error: ".mysql_error());
}
?>