Included within my login_results() function is the following code
// Conditional cookie statement
if($check == 'ON'){
// Register the authorised login cookie!
$auth = 1;
setcookie("authorised", $auth, time() + (172800));
}
Included in my index.php page is the following
<?php
if (isset($_POST['submit']) && $_POST['submit'] == 'Login')
{
login_results();
}
if (($_SESSION['LoggedIn'] == 1) || (isset($_COOKIE[authorised])))
{
echo '
Welcome <font color="#003366">' . $_SESSION['username'] . '</font> , you are logged in. <br><br>
[<a href="?action=logout">Logout</a>]
';
number_of_members();
}
else
{
login_form();
number_of_members();
}
I am getting the following error.
Cannot modify header information - headers already sent by ......
And one more question. If I want to display the username, the session username variable will have expired. Will i have to store the username in the cookie also?
???