Click to See Complete Forum and Search --> : SESSION_START() Problems...


wk4997
05-19-2004, 12:40 AM
I am beginning to learn how to authenticate via MySQL and every time I try to use session_start(), then following stuff appears:
Warning: Cannot send session cookie - headers already sent by (output started at /home/httpd/
html/testdir/verify.php:7) in /home/httpd/html/testdir/verify.php on line 31

Warning: Cannot send session cache limiter - headers already sent (output started at /home/httpd/
html/testdir/verify.php:7) in /home/httpd/html/testdir/verify.php on line 31
Thanks!
You're now logged in as kalataw



Also, here's my code that i'm using when the actual login verification is done:
else{
$PHP_AUTH_USER = $username;
$PHP_AUTH_PW = $password;
session_start();
session_register("PHP_AUTH_USER");
session_register("PHP_AUTH_PW");
echo "Thanks!<BR>\n";
echo "You're now logged in as ". $_SESSION['PHP_AUTH_USER']. "<BR>\n";
echo "<A HREF=logout.php>Click here</A> to logout.";
session_destroy();
}
}



What am I to do???
-Wes

Khalid Ali
05-23-2004, 10:14 AM
post your php code at the very top of your page no html before the php part..that usually is the typical solution,unless you are sending an out put from some other php file which is imported in this file,