PHP Help
Posted: Fri Aug 08, 2003 8:18 am
Hi Guys,
I need some help. I am messing around with sessions variable.
This is the code.
<----START---->
<html>
<head>
<title></title>
<style></style>
</head>
<body>
<?
$a = session_start();
$_SESSION["tt"] = "aa";
echo $_SESSION["tt"] . "<br>";
$a = session_id();
echo $a;
$a = session_destroy();
/*
if (session_is_registered($_SESSION["sessSt"])) {
echo "Session Started";
}
else {
echo "Session not started";
$_SESSION["sessSt"] = 0;
}
*/
?>
</body>
</html>
<----END---->
And I've got this error.
Warning: Cannot send session cookie - headers already sent by (output started at /var/www/html/test.php:4) in /var/www/html/test.php on line 9
Warning: Cannot send session cache limiter - headers already sent (output started at /var/www/html/test.php:4) in /var/www/html/test.php on line 9
aa
d395371639205ece2f142c096a55611c
It seems that the script has implicitly register a session starting from <?
Can anyone please tell me whats going on here?
Thanks,
Andrew
I need some help. I am messing around with sessions variable.
This is the code.
<----START---->
<html>
<head>
<title></title>
<style></style>
</head>
<body>
<?
$a = session_start();
$_SESSION["tt"] = "aa";
echo $_SESSION["tt"] . "<br>";
$a = session_id();
echo $a;
$a = session_destroy();
/*
if (session_is_registered($_SESSION["sessSt"])) {
echo "Session Started";
}
else {
echo "Session not started";
$_SESSION["sessSt"] = 0;
}
*/
?>
</body>
</html>
<----END---->
And I've got this error.
Warning: Cannot send session cookie - headers already sent by (output started at /var/www/html/test.php:4) in /var/www/html/test.php on line 9
Warning: Cannot send session cache limiter - headers already sent (output started at /var/www/html/test.php:4) in /var/www/html/test.php on line 9
aa
d395371639205ece2f142c096a55611c
It seems that the script has implicitly register a session starting from <?
Can anyone please tell me whats going on here?
Thanks,
Andrew