A
Anonymous
Guest
32
<?php
ob_start();
if(!$_POST['user'] && !$_POST['pass'])
{
// your form here
}
else
{
if($_POST['user'] == "admin" && $_POST['pass'] == "yourpass")
{
$_SESSION['logon'] = true;
header("location: admin.php");
}
else
{
echo "Username or password are wrong. Please go back and check your details";
}
}
ob_flush();
?>
<?php
ob_start();
if(!$_SESSION['logon'])
{
include("login.php"); // if your are not loged in it will print your the login page.
}
else
{
// if your are loged on, print your page here :P
}
ob_flush();
?>