Thankyou that worked
would you be able to tell me why my session is being set?
<?php
session_start(); // must be at the VERY top of all pages that GET or SET session objects
$pagetitle = "Login Page";
if (isset ($_POST['submit'])) {
$_SESSION['LoggedIn'] = false;
$file = fopen ( 'users.txt', 'rb' );
while ($line = fgetcsv($file,100,",")) {
if (($line[0] == $_POST['username']) AND ($line[1] == ($_POST['password']) ) ) {
//$loggedin = TRUE;
$_SESSION['LoggedIn'] = true; // set login session successful!
//break;
}
}
if ($SESSION['LoggedIn']) {
$SESSION['username'] = $username;
header("Location: content3.php");
exit;
} else {
echo '<br>The username and password did not match!';
}
}
include_once('template/header.inc.php');
?>