file_get_contents
1#@!#!123s
D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
u247928417
/
domains
/
fruitbagan.com
/
public_html
/
androidapplication
/
Filename :
mobile-resend-otp.php
back
Copy
<?php include("config/database.php"); error_reporting(0); //If a post request is detected if($_REQUEST['UserId']!='' and $_REQUEST['mobile']!=''){ /*************************sms Details start here*************************/ $apiKey = urlencode('eCPo5qO8iPk-sjmFaNGftigzd2CS8T4JasSjqRsxi7'); //Generating a 6 Digits OTP or verification code $otp = rand(100000, 999999); // Message details $numbers = array($_REQUEST['mobile']); $sender = urlencode('jivika'); $message = rawurlencode("Your one time password for validate Bharat Jivika registration or login is $otp"); $numbers = implode(',', $numbers); // Prepare data for POST request $data = array('apikey' => $apiKey, 'numbers' => $numbers, "sender" => $sender, "message" => $message); // Send the POST request with cURL $ch = curl_init('https://api.textlocal.in/send/'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); // Process your response here $response; if($response=='{"errors":[{"code":192,"message":"Messages can only be sent between 9am to 9pm as restricted by TRAI NCCP regulation"}],"status":"failure"}'){ echo '{"message":"false"}'; } else if($response!='{"errors":[{"code":192,"message":"Messages can only be sent between 9am to 9pm as restricted by TRAI NCCP regulation"}],"status":"failure"}'){ /************************************************/ //insert data into otp table $insertOtp="insert into interface_user_otp(otp_number,otp_customer_id,otp_flag,otp_date)values('".$otp."','".$_REQUEST['UserId']."','0','".date('Y-m-d')."')"; $QueryOtp = mysqli_query($conn,$insertOtp) or mysqli_error($conn); echo '{"message":"true"}'; }else{ echo '{"message":"false"}'; } } ?>