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.227.21.101
<?php
include ("database.php");
ini_set('display_errors', 'on');
//include("sendsmsapi.php");
require_once('../../sms/sendsmsapiv1.php');
$mobile = trim($_POST['mobile']);
$dob = trim($_POST['dob']);//password
$passwd = trim($_POST['password']);
$query = "select ifnull(fmobileotp,'') as fmobileotp
from masstud where fmobileno = '{$mobile}'
and ROUND(time_to_sec((TIMEDIFF(NOW(), fmobotptime))) / 60) <= 5";
$result = mysqli_query($conn,$query);
$count = mysqli_num_rows($result);
date_default_timezone_set('Asia/Kolkata');
$time = date("h:i A");
date_default_timezone_set('Asia/Kolkata');
$time = date("h:i A");
$FFOLDER = "GCG";
if($count > 0)
{
$row = mysqli_fetch_assoc($result);
$motpaswrd = $row['fmobileotp'];
$smsotp = "From $FFOLDER: Dear Student, OTP for Registration is $motpaswrd. sent at {$time} - Uniclare";
//$smsotp = "Dear Student, Your mobile OTP for Registration is, {$motpaswrd} sent at {$time}";
}
else
{
$motpaswrd = rand(1000, 9000); //strtoupper(substr(sha1(rand()), 0, 4));
$smsotp = "From $FFOLDER: Dear Student, OTP for Registration is $motpaswrd. sent at {$time} - Uniclare";
}
$username = 'logisyhttp';
$password = 'logisy@928';
$from = 'UNISOL';
$to = $mobile;
$text = $smsotp;
$category = '';
$sms = new SMS('026', 'OTP');
$sms->sendIndvidualSms($mobile, $smsotp, '900', 'PGET');
//$smsresp = sendsmaapi($username,$password,$from,$to,$text,$category);
$arr["sms"] = $smsresp;
$query = "update masstud set fmobileotp = '{$motpaswrd}', fmobotptime = now(),
fdob = '{$dob}', fpasswd ='{$passwd}',fotpcounter = fotpcounter+1
where fmobileno = '{$mobile}'";
if(mysqli_query($conn,$query))
{
$arr["status"] = 'success';
}
else
{
$arr["status"] = 'error';
}
//$arr["email"] = $data['message'];
echo json_encode($arr);
?>
|