/This is assuming you are using the Unix time stamp and MySQL. /
$lasthour = time() - 3600;
$sql = "select time, ip from your_table where time > $lasthour and ip = '$ip' order by time desc";
$res = mysql_db_query("localhost", $sql);
if(!mysql_fetch_array($res))
{
echo "<script language=\"javascript\">\n";
echo "\twindow.open('yoururl')\n";
echo "</script>\n";
}
$now = time();
$sql = "insert into your_table (time, ip) values ('$now', '$REMOTE_ADDR'))";
mysql_db_query("localhost", $sql);
Probably better ways to do it but that should work.