<?php
include("includes/connect.php");
if(isset($_POST['login'])){
$user_name = $_POST['user_name'];
$user_pass = $_POST['user_pass'];
$admin_query = "select * from admin_login where user_name='$user_name' AND user_pass='$user_pass'";
$run=mysql_query($admin_query);
if(mysql_num_rows($run)>0){
//echo (mysql_num_rows($run));
$_SESSION['user_name']=$user_name;
header('location:index.php');
//echo "<script>window.open('index.php','_self')</script>";
}
else{
echo "<script>alert('User name or password is incorrect')</script>";
}
}
?>
I am unable to login to the index page. When I give the wrong credential, it pops up the error. But when I give the right credentials, it doensn't pop any error. but still couldn't able to login. Please help.
I have included this on my index.php
<?php
session_start();
if(!isset($_SEESION['user_name'])){
header("location:login.php");
}
else {
?>