I'm trying to login admin and a user but why it didn't get the admin page? can you help me with this guys?. because it only display index.php when login.
<?php
session_start();
include('connect.php');
$emailaddress = $_POST['emailaddress'];
$password = md5($_POST['password']);
$search = mysql_query("SELECT * FROM users WHERE email='".$emailaddress."' AND password='".$password."' AND active='1'") or die(mysql_error());
$match = mysql_num_rows($search);
if($match){
$_SESSION["email"] = $emailaddress;
$_SESSION["password"] = $password;
$_SESSION["firstname"] = mysql_result($search,0,"fname");
$_SESSION["lastname"] = mysql_result($search,0,"lname");
header('Location: index.php');
$msg = 'Login Complete! Thanks';
}
elseif ($match) {
$_SESSION["emailaddress"] == 'admin@iva.com';
$_SESSION["password"] == 'password';
header('Location: admin.php');
$msg = 'Login Complete! Thanks';
}
else{
$msg = 'Login Failed! Please make sure that you enter the correct details and that you have activated your account.';
}
can you help me with this guys?...