Anyone? Please :) John Taylor-Johnston wrote:
> This is what I'm using so far. But I need to put in a time stamp to calculate if the > visitor is new. I want to use the IP so if the ip saved in MySQL is older than 60 > minutes, it will write a new record, if not, don't: > > $myconnection = mysql_connect($server,$user,$pass); > mysql_select_db($db,$myconnection); > > $getaddr = $_SERVER['REMOTE_ADDR']; > $gethost = gethostbyaddr($_SERVER['REMOTE_ADDR']); > $EntryDate = date("Y-m-d"); > > $sql = "INSERT INTO $table (IPAddress,RemoteHost,EntryDate) > values('$getaddr','$gethost','$EntryDate')"; > mysql_query($sql); > > $myconnection = mysql_connect($server,$user,$pass); > mysql_select_db($db,$myconnection); > $result = mysql_query("SELECT * FROM $table", $myconnection); > $num_rows = mysql_num_rows($result); > > echo "document.write(\"$num_rows visitors. \");"; -- John Taylor-Johnston ----------------------------------------------------------------------------- "If it's not open-source, it's Murphy's Law." ' ' ' Collège de Sherbrooke: ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/ - Université de Sherbrooke: http://compcanlit.ca/ 819-569-2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php