Preview: submit-login.php
Size: 977 B
/home/urbanman/roadkaraja.in/manager/submit-login.php
<?php
error_reporting(0);
@session_start();
include("config.php");
$mobile=$_POST['mobile'];
$password=$_POST['password'];
// To protect MySQL injection (more detail about MySQL injection)
$mobile = stripslashes($mobile);
$password = mysql_real_escape_string($password);
//$password = md5($password);
$sql="SELECT * FROM manager WHERE manager_mobile='$mobile' AND password='$password' ";
$result=mysql_query($sql);
$row = mysql_fetch_array($result);
// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
//echo $count; exit;
if($count==1){
// Register $myusername, $mypassword and redirect to file "login_success.php"
$_SESSION['branch']=stripslashes($row['branch']);
$_SESSION['manager_name']=$row['manager_name'];
header("location:welcome.php?flag=dn");
exit;
}
else {
header("location:index.php?flag=invalid");
exit;
}
?>
Directory Contents
Dirs: 5 × Files: 59