I have looked at many other sites that state the problem is because of white spacing. I dont think that is the problem since I dont leave any white spacing after the end of my php script and before the begginning of my php script. Here is the full error
: Cannot modify header information - headers already sent by (output started at /admin/login.php:19) in admin/login.php on line 22
Here is my code:
require_once("../../includes/database.php");
require_once("../../includes/session.php");
require_once("../../includes/user.php");
if($session->is_logged_in())
{
header("Location:index.php");
}
if(isset($_POST['submit']))
{
$username = trim($_POST['username']);
$password = trim($_POST['password']);
//Check Databases
$found_user = User::authenticate($username, $password);
$found_user->id = $found_user[0];
if($found_user)
{
$session->login($found_user);
header("Location:index.php");
}
else
{
echo "Username/password combination incorrect.";
}
} else { //form is not submitted
$username = "";
$password = "";
}
?>
Photo Gallery
Staff Login
{
$database->close_connection();
}
?>
No comments:
Post a Comment