Possible Duplicates:
PHP headers already sent
PHP session_start() error?
What does this error mean?
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/html/index.php:7) in /home/content/html/index.php on line 44
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/html/index.php:7) in /home/content/html/index.php on line 44
Here is my code:
session_start ();
if ($_SESSION['username']){
echo "User: " .$_SESSION['username']."<br>";
echo "<a href='logout.php'>Logout</a> <a href='account.php'>Account</a>";
}else{
echo "<a href='index.php'>Login</a> <a href='register.php'>Register</a>";
I have this code on my every page when I tested it on my localhost it works fine but when I uploaded the site on my remote server it displays this error. I can't understand why I can't start a session. I am using godaddy. Please help me.