<?php 
require_once "config1.php";
$uname=$_POST['uname'];
$pwd=$_POST['pwd'];
$msisdn=$_POST['msisdn'];
$otp = rand(10,100000);

$sql1="update admin_login set otp = '".$otp."' where uname = '".$uname."' and pwd = '".$pwd."'";
$query1=mysqli_query($con,$sql1);



// Declare the security credentials to use
	$smsusername = "amul123";
	$smspassword = "amulp91";
	$message  = $otp." is the OTP to login to billing software. Armol Polymers";
	$smstype     = "0";
	$smssenderid = "ARMOLP";
	$smsurl   = "http://login.redsms.in/api/smsapi?key=406e34f24250759a53202f2d198a18dc&route=2&";
	
				 

	// SMS API
	  $url = $smsurl .
			
			"sender="  . urlencode($smssenderid) . "&" .
			"number="     . $msisdn . "&" .
			"sms="  	 . urlencode($message) . "&" .
			
			"templateid="      . "1207168861880656304";
			
			
			
			//echo $url;

	  // Send the request
	  $output = file($url);
	// SMS API


echo "1";	

?>
	