<?php
//database connections
 ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
 if(isset($_POST['submit'])) {
 
 ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
 echo "SSS";
 $mobile = "9052019804";
 //$res=mysql_query("insert into mobileapp(mobile,date_added)values('$mobile',NOW())");
  $fields_string="";
$dt1="uomegov" ;

$dt2="zocampus" ;
$dt3="TSITIA" ;
 $mobileno = $mobile;




$message="Hello 9052019804, Your USER ID is 9052019804 and PASSWORD is 2FGBBC Please use this userid and password for Login, TSITI ADMISSIONS 2021";


//$url = "http://login.bulksmsglobal.in/api/sendhttp.php?authkey=5461ARlgm63Ryn7461163c68P32&mobiles=91'+mobileno+'&message='+message+'&sender=QVNTRU&route=6&country=91&DLT_TE_ID=1007588417611677282";
 
$url = "http://login.bulksmsglobal.in/api/sendhttp.php?authkey=2181AHMtScDZdO8r5357821b&mobiles=9052019804&message=Hello 9052019804, Your USER ID is 9052019804 and PASSWORD is 2FGBBC Please use this userid and password for Login, TSITI ADMISSIONS 2021&sender=TSITIA&route=default&country=91&DLT_TE_ID=1007523092534230131";
$fields = array(
						'username'=>$dt1,
						'password'=>$dt2,
						'sendername'=>$dt3,
						'mobileno'=>$mobileno,
						'message'=>$message
				);
				
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }


rtrim($fields_string,'&');

$ch = curl_init();

curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);

echo "<span style='display:none;'>";
$result = curl_exec($ch);
echo "</span>";

curl_close($ch);
 }
 
 ?>
 
 <form method="post" name="reg">
 <input type="text" name="mobile" id="mobile" />
 <input type="submit" name="submit" value="Submit" />
 
 
 </form>
 
 
 
 <?php

//Your authentication key
$authKey = "5461ARlgm63Ryn7461163c68P32";



//Multiple mobiles numbers separated by comma
$mobileNumber = "9052019804";

//Sender ID,While using route4 sender id should be 6 characters long.
$senderId = "TSITIA";

//Your message to send, Add URL encoding here.
$message = urlencode("Hello 9052019804, Your USER ID is 9052019804 and PASSWORD is 2FGBBC Please use this userid and password for Login, TSITI ADMISSIONS 2021");

//Define route 
$route = "default";
//Prepare you post parameters
$postData = array(
    'authkey' => $authKey,
    'mobiles' => $mobileNumber,
    'message' => $message,
    'sender' => $senderId,
    'route' => $route
);

//API URL
$url="http://login.bulksmsglobal.in/api/sendhttp.php?authkey=2181AHMtScDZdO8r5357821b&mobiles=${mobileNumber}&message=${message}&sender=TSITIA&route=6&country=91&DLT_TE_ID=1007523092534230131";








// init the resource
$ch = curl_init();
curl_setopt_array($ch, array(
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => $postData
    //,CURLOPT_FOLLOWLOCATION => true
));


//Ignore SSL certificate verification
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);


//get response
$output = curl_exec($ch);

if (curl_errno($ch)) {
    $error_msg = curl_error($ch);
	echo 'Request Error:' . curl_error($ch);
}
curl_close($ch);

//Print error if any


echo $output;
?>