I am using sessions to track visitors to my site, and one of the things I'd
like to do is add a time-stamp to each entry in my MySQL database. The
problem is that, for some reason, the time-stamp part only seems to work
part of the time.  I know it can't be, but it almost seems arbitrary - i
haven't been able to determine a pattern. The code I'm using follows:

<?
session_start();
session_register("origin");
session_register("ip_address");
session_register("browser");
session_register("id");
$modules = "/****/modules";
$page = "$modules/index.inc";
include("$modules/db_info2.inc");
$id = session_id();
$ip_address = "$REMOTE_ADDR";
$browser = "$HTTP_USER_AGENT";
$sessn_root = "sessn-log";
$origin = "$HTTP_REFERER";
$now = date("D M j, H:i");
$sql = "INSERT INTO $table_name
        (ndx, id, time, ip_address, browser, origin)
        VALUES
        (\"\", \"$id\", \"$now\", \"$ip_address\", \"$browser\", \"$origin\")";
$result = mysql_query($sql, $connection) or die("Couldn't update session
logs. MySQL error: " . mysql_error());
include("$modules/template.html.php");
?>

Can anyone help?
Thanks in advance!

Tom


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to