|
Server : Apache System : Linux p3plzcpnl507073.prod.phx3.secureserver.net 4.18.0-553.53.1.lve.el8.x86_64 #1 SMP Wed May 28 17:01:02 UTC 2025 x86_64 User : swg98tjyzel1 ( 5098476) PHP Version : 8.1.34 Disable Function : NONE Directory : /home/swg98tjyzel1/public_html/bityatra.com/ |
Upload File : |
<?php
session_start();
/************************Generate OTP**************************/
if($_POST['page']=="otpGenerate")
{
$mobno=$_POST['mobno'];
$rand=rand(1111,9999);
if(isset($_SESSION['otpval'])){
unset($_SESSION["otpval"]);
}
$_SESSION['otpval']=$rand;
$_SESSION['mobno']=$mobno;
$message="Dear Customer OTP to approve your Registration through BITYATRA is ".$rand.". Do not share OTP with anyone.";
$message = urlencode($message);
$url="http://smsodisha.in/sendsms?uname=bityatra&pwd=123456&senderid=BITYRA&to=".$mobno."&msg=".$message."&route=T&peid=1701168381483694287&tempid=1707168545352957614";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$APIresponse = curl_exec($ch);
curl_close($ch);
$res = json_decode($APIresponse, true);
if($res['ErrorCode'] != '000') // check for the response return by the API
{
$response=1;
}
else
{
$response=2;
}
echo $response;
}
if($_POST['page']=="otpCheck")
{
$otp=$_POST['otp'];
$otpval=$_SESSION['otpval'];
if($otp==$otpval){
echo 1;
}else{
echo 2;
}
}
/************************Generate OTP**************************/
if($_POST['page']=="otpPage")
{
$mobno=$_POST['mobno'];
$rand=rand(1111,9999);
if(isset($_SESSION['otpval'])){
unset($_SESSION["otpval"]);
}
$_SESSION['otpval']=$rand;
$_SESSION['mobno']=$mobno;
$message=$rand." is your one time verification code for Login at AssetLive, its valid for 10mins. SHAKTI FACILITIES SERVICES PRIVATE LIMITED";
$message = urlencode($message);
$url="http://bulksms.saakshisoftware.in/api/mt/SendSMS?APIKey=mfb5GRuWK0uEFy41OLr4cw&senderid=TMLIVE&channel=trans&DCS=0&flashsms=0&number=".$mobno."&text=".$message."&route=04&DLTTemplateId=1207168059541500275&PEID=1201168006886726020";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$APIresponse = curl_exec($ch);
curl_close($ch);
$res = json_decode($APIresponse, true);
if($res['ErrorCode'] == '000') // check for the response return by the API
{
$response=1;
}
else
{
$response=2;
}
echo $response;
}
?>