Page 1 of 1

error when using login script

Posted: Tue Jun 24, 2008 5:30 pm
by pugs
Hi all,

I'm getting this error in my browser when using a login script. I'm checking a username and password against a database and if successful, registering a session.

Warning: session_register() [function.session-register]: Cannot send session cookie - headers already sent by (output started at /home/val2435/public_html/newsite/checklogin.php:9) in /home/val2435/public_html/newsite/checklogin.php on line 38

Warning: session_register() [function.session-register]: Cannot send session cache limiter - headers already sent (output started at /home/val2435/public_html/newsite/checklogin.php:9) in /home/val2435/public_html/newsite/checklogin.php on line 38

Warning: Cannot modify header information - headers already sent by (output started at /home/val2435/public_html/newsite/checklogin.php:9) in /home/val2435/public_html/newsite/checklogin.php on line 40

Can anyone help?

Re: error when using login script

Posted: Tue Jun 24, 2008 5:48 pm
by Christopher
You have already sent some output before line 38. It could be obvious HTML output or a space or return before a <?php or after a ?>

Re: error when using login script

Posted: Tue Jun 24, 2008 5:49 pm
by Eran
you need to use session_start() and cookie functions before any output is sent to the browser

try this one

Posted: Fri Jun 27, 2008 6:43 am
by azhan
i've use this login script..so far...it works!....it has the database script,registering script,login script and logout script.

----->>>> http://php.about.com/od/finishedphp1/ss ... code_4.htm


regards,

Azhan
________________________________________
http://www.productcoverdesign.com - Cheapest E-Cover u'll ever get!