PHP:Wrong Login info does not redirect to the specific page
- by sdr
<?php
include 'lib/db_conn.php';
$uid=$_REQUEST['uid'];
$pass=$_REQUEST['pass'];
if(($uid==NULL && $pass==NULL) ||($uid==NULL) ||($pass==NULL))
{
header("location:index.php?msg=Fields can't be left blank..");
}
$pass=md5($pass);
$sql1="SELECT * FROM `tb_user` WHERE `email`='$uid' AND `pass`='$pass'";
$rs1=mysql_query($sql1) or die (mysql_error());
$row1=mysql_fetch_array($rs1) or die (mysql_error());
$email=$row1['email'];
if($uid==$email)
{
session_start();
$_SESSION['id']=$row1['id'];
header("location:home.php");
}
else
{
header("location:index.php?msg=Wrong Credentials..");
}
?>