GIF89a php
Current File : /home/viralhoga/public_html/rsendotp.php
<?php 
session_start();
if(isset($_SESSION['otpCandidate']) && !empty($_SESSION['otpCandidate'])){
include('adminpanel/config.php');
$contacts=$_SESSION['otpCandidate'];

date_default_timezone_set('Asia/Calcutta');
$entrydate= strtotime(date('d-m-Y  H:i:s'));
$otp=date('shi');
//check user exist or new
$update_otp = mysqli_query($con,"update `otp_tbl` set otp='$otp' where sess_id='$contacts'");
if($update_otp){
 // SMS API endpoint URL
$apiUrl = 'http://nimbusit.biz/api/SmsApi/SendSingleApi';
// API parameters
$params = array(
    'UserID' => 'Manojbiz',
    'Password' => 'ytsb9485YT',
    'SenderID' => 'VYGPHG',
    'Phno' => $contacts,
    'Msg' => 'Dear user, Thank you for registering to ViralHoga.Com from Voyage Partner. Your one time password is '.$otp.'Please do not share your OTP with anyone.',
    'EntityID' => '1001881168520452964',
    'TemplateID' => '1007399545368085942',
);

// Build the query string
$queryString = http_build_query($params);

// Complete API URL with query string
$fullUrl = $apiUrl . '?' . $queryString;

// Make the HTTP request
$response = file_get_contents($fullUrl);
//end otp code
  
  echo 1;
}else echo 0; 
}else header('location:/');
?>