Page 1 of 1

sessions error...

Posted: Tue Jan 10, 2006 7:17 pm
by spamyboy
HawleyJR | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Code: Select all

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\apache\xampp\htdocs\index.php:8) in C:\apache\xampp\htdocs\index.php on line 51

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\apache\xampp\htdocs\index.php:8) in C:\apache\xampp\htdocs\index.php on line 51
and here is line 51:

Code: Select all

<?php
session_start();
if($_SESSION['auth'] == true){
echo '<a href="index.php?page=logout">log out</a>';
}else{
    echo '<a href="index.php?page=login">login</a><span class="style4"> &bull;</span> <a href="index.php?page=register">register</a>';
}
?>
HawleyJR | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Tue Jan 10, 2006 7:57 pm
by spamyboy
HawleyJR sorry ;/

Posted: Tue Jan 10, 2006 8:12 pm
by John Cartwright
search on these forums for "headers already sent"

Posted: Tue Jan 10, 2006 8:25 pm
by raghavan20
maku sure the php code is on the top of the php file....make sure these php lines are the first lines in the php code...as jcart says you can search for similar posts or you can google to find solutions to many similar problems.