Hi, i am getting the following errors when running my php script:
Warning: Cannot send session cookie - headers already sent by (output
started at
c:\apache\apach e2\htdocs\thega in\index.php:4) in
c:\apache\apach e2\htdocs\thega in\index.php on line 19
Warning: Cannot send session cache limiter - headers already sent
(output started at
c:\apache\apach e2\htdocs\thega in\index.php:4) in
c:\apache\apach e2\htdocs\thega in\index.php on line 19
....the script i am trying to run is as follows:
<?php
session_start() ; //start session to get session variables
//this code is to check if a custom session variable exists. if none,
create one.
if (!isset($custom _sessid)) {
$custom_sessid = md5($_SERVER['REMOTE_ADDR'] . " " . date("Y-m-d
H:i:s")); // create a session id
session_registe r("custom_sessi d"); // register newly ceated session
variable
}
$indate = date("Y-m-d H:i:s");
$page_id = 1; //each page will have its own number
$insert = "INSERT INTO tracker (tracker_id, page_id, indate,
custom_sessid) values (null, $page_id,
'$indate', '$custom_sessid ')";
$result = mysql_query($in sert);
?>
....the purpose of the tracker table is to log the session id and the
page number to have a complete log of pages visited by a user
(identified by their session id) to allow me to build some form of
site statistics but for some reason i am getting an error (see above).
does anybody know why this is?? cheers
burnsy
Warning: Cannot send session cookie - headers already sent by (output
started at
c:\apache\apach e2\htdocs\thega in\index.php:4) in
c:\apache\apach e2\htdocs\thega in\index.php on line 19
Warning: Cannot send session cache limiter - headers already sent
(output started at
c:\apache\apach e2\htdocs\thega in\index.php:4) in
c:\apache\apach e2\htdocs\thega in\index.php on line 19
....the script i am trying to run is as follows:
<?php
session_start() ; //start session to get session variables
//this code is to check if a custom session variable exists. if none,
create one.
if (!isset($custom _sessid)) {
$custom_sessid = md5($_SERVER['REMOTE_ADDR'] . " " . date("Y-m-d
H:i:s")); // create a session id
session_registe r("custom_sessi d"); // register newly ceated session
variable
}
$indate = date("Y-m-d H:i:s");
$page_id = 1; //each page will have its own number
$insert = "INSERT INTO tracker (tracker_id, page_id, indate,
custom_sessid) values (null, $page_id,
'$indate', '$custom_sessid ')";
$result = mysql_query($in sert);
?>
....the purpose of the tracker table is to log the session id and the
page number to have a complete log of pages visited by a user
(identified by their session id) to allow me to build some form of
site statistics but for some reason i am getting an error (see above).
does anybody know why this is?? cheers
burnsy
Comment