<?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..");
}
?>
<?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
Share
it is better not to write a message in the address bar but just tokenize it, i.e.:
and in the index.php:
And, as Kai mentioned,
$uid=$_REQUEST['uid'];must beAlso, as dnagirl mentioned, field emptiness checking is wrong.
Also, as I am to mention,
exitmust follow any location header