File: /home/cafsindia/refimac_cafsjobs_com/validate.php
<?php
include('dbconnect.php');
$time_now=time(date('h')+5,date('i')+30,date('s'));
$time=date('h:i:s A',$time_now);
$from1=date("d-M-Y");
$update_time=$from1.", ".$time;
$sql="select * from serviceapp_login where user_name='".$_REQUEST['login_name']."' and password='".$_REQUEST['login_password']."' and status='Allowed'";
$qu=mysql_query($sql);
$row=mysql_num_rows($qu);
//echo $sql; die;
if($row==1)
{
$r=mysql_fetch_assoc($qu);
//$_SESSION["user_id"]=$r['id'];
$_SESSION["clid"]=$r['user_name'];
$_SESSION["cper"]=$r['per'];
echo "success";
}
else
{
$count=1;
$_SESSION["attempt"]+=$count;
if($_SESSION["attempt"]==4)
{
$sql="update serviceapp_login set status='Denied' where user_name='".$_REQUEST['login_name']."'";
$qu=mysql_query($sql);
$row=mysql_num_rows($qu);
echo "Failed";
}
else
{
echo "Denied";
}
}
?>