DATE
| From: | Zenton | Date: | Tue, 12 Sep 2000 11:51:37 +0000 |
| Subject: | DATE | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-2592@lists.php.net to get a copy of this message | ||
I am usoing this script below to log visitors to a mySQL database on a
Zeus webserver.
The log files are all fine except for the date field that reads 00:00:00
etc etc.. is this a timestamp issue? Anyone know how I can get around
this prob?
Script follows, much obliged.
Karl
<?
$cnx = @mysql_connect("hsot","user","pass");
if(!$cnx)
{
echo "<p>Sorry the network resource is unavailable, $cnx</p>";
exit();
}
$db = mysql_select_db(database);
if (!$db)
{
echo "Unable to select requested resource.";
exit();
}
$browser = $HTTP_USER_AGENT;
$date = date("F jS Y, h:iA");
if
($REMOTE_HOST == "") {$host = $REMOTE_ADDR;} else {$host =
$REMOTE_HOST;}
if( empty( $HTTP_REFERER ) or '' == $HTTP_REFERER ) {$HTTP_REFERER = 'No
Referer';}
mysql_query ("INSERT INTO statinfo (browser, date, host, referer) VALUES
('$browser','$date','$host','$HTTP_REFERER' )");
mysql_close($cnx); ?>