Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 18.118.19.89
<?php
include ("database.php");
error_reporting(E_ALL);
ini_set('display_errors', 'on');
$mobile = trim($_POST['mobile']);
$mobileotp = trim($_POST['motp']);
$emailotp = trim($_POST['eotp']);
//and fmobileotp = '3313'
$query = "SELECT * from masuser
where fmobileno = '{$mobile}'
and fmobileotp = '{$mobileotp}'
and femailotp = '{$emailotp}'
and ROUND(time_to_sec((TIMEDIFF(NOW(), fmobotptime))) / 60) <= 5";
$result = mysqli_query($conn,$query);
$row = mysqli_fetch_assoc($result);
$count = mysqli_num_rows($result);
if($count >0)
{
$query = "update masuser set femailvalid = 'T',
fmobilevalid = 'T', factive = 'T'
where fmobileno = '{$mobile}'";
$result = $conn->query($query);
if($result == 1)
{
$arr["status"] = 'success';
$ip = $_SERVER['REMOTE_ADDR'];
$strUserLogQuery = "insert into userlog
(funivcode, fregno, fmobileno, fipadd, FREASONCODE, FDESCPN)
values
('{$row['FUNIVCODE']}', '{$row['FREGNO']}', '{$row['FMOBILENO']}', '{$ip}',
'REGN', 'REGN - {$row['FREGNO']} Registered to Student Portal')";
$result = mysqli_query($conn,$strUserLogQuery);
}
else
{
mysqli_close($conn);
$arr["status"] = 'error';
}
}
else
{
mysqli_close($conn);
$arr["status"] = 'invalid';
}
echo json_encode($arr);
?>
|