You are on page 1of 1

<?

php
session_start();
$con= mysqli_connect("localhost","root","","destiny");

if(!$con){
die("Connection failed : ".mysqli_connect_error());
}

$email = $_POST['email'];
$password = $_POST['password'];
$_SESSION['admin_destiny@gmail.com'] = $email;
$_SESSION['destiny123'] = $password;

if(empty($email) || empty ($password)){


header('Location: AdminErrorPage.php');
}

else
{
$sql = "SELECT * FROM admin where UserName='$email' and
Password='$password' ";
$result = $con->query($sql);

if(!$row = $result->fetch_assoc()){
header('Location: admin.html');
}
else
{
header('Location: Admin.php');
}
}
?>

You might also like