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 : 3.148.112.15
Current Path : /var/www/html/pgadm/ |
| Current File : /var/www/html/pgadm/resetpassword.php |
<?php
include ("database.php");
$mobile = trim($_POST['mobile']);
$otp = trim($_POST['otp']);
$passwd = trim($_POST['password']);
$query = "select fresetotp from collstud where fmobileno = '{$mobile}'
and ROUND(time_to_sec((TIMEDIFF(NOW(), fresetotptime))) / 60) <= 15
and fresetotp = '{$otp}'";
$result = mysqli_query($conn,$query);
$count = mysqli_num_rows($result);
if($count > 0)
{
$query = "update collstud set fpasswd ='{$passwd}'
where fmobileno = '{$mobile}'";
// var_dump($query);
// die();
$result = mysqli_query($conn,$query);
if (mysqli_query($conn,$query))
{
$arr["status"] = 'success';
}
else
{
$arr["status"] = 'error';
}
}
else
{
$arr["status"] = 'invalid';
}
echo json_encode($arr);
?>
|