require_once("/home/users/web/b1565/pow.daviddude/htdocs/functions.php"); do_header("WOW!", "menu.txt"); $visitorIP = $REMOTE_ADDR; $visitorTime = gmmktime(); $visitorTimePlus = $visitorTime + 60; $visitorTimeMinus = $visitorTime - 60; $conn = db_connect() or die("Error connecting to database. ".mysql_error()); $result = mysql_query("SELECT * FROM wowPage WHERE wowPageIP = '$visitorIP' AND wowPageTime BETWEEN '$visitorTimeMinus' AND '$visitorTimePlus'") or die("Error querying database. ".mysql_error()); if (mysql_num_rows($result)<1) mysql_query("INSERT INTO wowPage SET wowPageIP = '$visitorIP', wowPageTime = '$visitorTime'") or die("Error inserting into database. ".mysql_error()); $result = mysql_query("SELECT * FROM wowPage ORDER BY wowPageTime DESC") or die("Error querying database. ".mysql_error()); ?>
There's not really anything on this page. Just a list of all of the people who have visited it. Pretty cool, eh?! :-)
Time visited (G.M.T.) |
IP Address |
---|---|
$displayTime | \n"; echo "\t\t\t$wowPageIP | \n"; echo "\t\t
Note: to prevent people doing what I would do--refreshing millions of time to make the table get really big--the values only update once per minute for a given IP address. Sorry to ruin your fun! :-)
do_footer(); ?>