Hi, ive been trying to get into sessions, ive read every tutorial from webmonkey to evilwalrus to php builder and everything was going ok until i hit a snag.
heres my code. Problem is i get two error codes when i run it now,
Warning: Cannot send session cookie - headers already sent by (output started at /.....(path lists).../session3.php4:9) in /.....(path lists).../session3.php4 on line 11
Warning: Cannot send session cache limiter - headers already sent by (output started at /usr/local/etc/httpd/vhosts/uniswap/session3.php4:9) in /usr/local/etc/httpd/vhosts/uniswap/session3.php4 on line 11
just in case you were wondering, line 11 is the session_start() function. If i remove it then the session doesn't show up at all!.
please help if you can
<?
session_start();
if(!PHPSESSID)
{
session_register("yourusername");
session_register("yourpassword");
}
else if((!$yourusername) || (!$yourpassword))
{
session_register("yourusername");
session_register("yourpassword");
}
if($username&&$password)
{
$yourusername = $username;
$yourpassword = $password;
print("<a href=\"$PHP_SELF.$PHPSESSID\">test session</a><br><br>");
}
echo $yourusername;
print("<br>");
echo $yourpassword;
print("<br>");
?>