I included login.php and loggedin.php files in index.php.
both login.php and index.php has no session_start(); and only loggedin.php has session_start(); in it.
but still I am getting the following errors when I open index.php:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/98/10855698/html/symp13/index.php:110) in /home/content/98/10855698/html/symp13/loggedin.php on line 2
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/98/10855698/html/symp13/index.php:110) in /home/content/98/10855698/html/symp13/loggedin.php on line 2
The loggedin.php is as follows:
<?php
session_start();
if (isset($_SESSION['username'])) {
echo 'you are logged in as'.' '.$_SESSION["username"];
echo '<form action="upload.php" method="post" enctype="multipart/form-data" name="upload">'.'<input type="file" name="file" /><input type="submit" name="submit" />'.'</form>'; }
else {
echo 'You need to login in with your account for submitting abstract or for applying for tutorials!';
echo 'Click here to'.' '.'<a href="login.php">login</a>';
}
?>
login.php includes a form with action set to login_check.php which includes session_start();. But I dont think that is the problem..because, it cant be run until the form is submitted.
And if I run only loggedin.php in a separate file. it is showing no errors.
I am confused. Please tell me how to solve this and also the cause.