<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {font-family: Arial, Helvetica, sans-serif;}
* {box-sizing: border-box;}

input[type= number], select, textarea {
  width: 60%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  margin-top: 6px;
  margin-bottom: 16px;
  resize: vertical;
}

input[type=submit] {
  background-color: #4CAF50;
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

input[type=submit]:hover {
  background-color: #45a049;
}

.container {
  border-radius: 5px;
  background-color: #f2f2f2;
  padding: 20px;
}
</style>





<?php

function send_sms($mobilenum,$smst) {
  $url = "http://esms.mimsms.com/smsapi";
  $senderidnumber="8809612446205";

  $data = [
    "api_key" => "{C20065835fb71c8de7fbe3.01693003}",
    "type" => "{text}",
    "contacts" => "$mobilenum",
    "senderid" => "{$senderidnumber}",
    "msg" => "{$smst}"
  ];
  echo "api_key";
	echo "{$senderidnumber}";
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  $response = curl_exec($ch);
  curl_close($ch);
  //return $response;
  echo $response;
}
?>
</head>



<body>

<?php







if(isset($_POST['submit'])){
	$mobilenumber=$_POST['mobilenumber'];
	$smstxt=$_POST['smstxt'];
	
	
	//$url = "http://esms.mimsms.com/smsapi";
  //$apikey="C20065835fb67a4c49db66.00762666";
  //$type="text";
  //$contact = "$mobilenumber";
 
    
  //$senderid="8809612446205";
  //$smst = "$smstxt";
 send_sms($mobilenumber,$smstxt);
 
 
/* try{
 $soapClient = new SoapClient("https://api2.onnorokomSMS.com/sendSMS.asmx?wsdl");
 $paramArray = array(
 'apiKey' => "d01abdc7-4774-45d9-b01e-878cc79c53b4",
 'messageText' => $smst,
 'numberList' => $mobilenumber,
 'smsType' => "TEXT",
 'maskName' => '',
 'campaignName' => '',
 );
 $value = $soapClient->__call("NumberSms", array($paramArray));
 //echo $value->numberSmsResult;
} catch (Exception $e) {
 echo $e->getMessage();
}*/
 
 
 
  /*$data = ["api_key" => ($apikey),"type" => $type,"contacts" => $contact,"senderid" => $senderid,"msg" => $smst];
  
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  $response = curl_exec($ch);

  curl_close($ch);
  //return $response;
	echo $response;*/
	
}
?>



<h3>SMS Form</h3>

<div class="container">
  <form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post">
    <label for="mobile">Mobile Number</label><br>
    <input type="number" id="mobile" name="mobilenumber" placeholder="Type Mobile Number."><br>

    <label for="smstxt">SMS</label><br>
    <textarea id="smstxt" name="smstxt" placeholder="Write SMS.." style="height:200px"></textarea><br>

    <input type="submit" name="submit" value="Send SMS">
  </form>
</div>

</body>
</html>
