<?php 
require_once("confing.php");

$msg = htmlspecialchars(strip_tags($_POST['msg'], ENT_QUOTES));
$mobile = htmlspecialchars(strip_tags($_POST['mobile_no'], ENT_QUOTES));

// Optional logging
file_put_contents("log.txt", "MSG: $msg, MOBILE: $mobile\n", FILE_APPEND);

// Prepare CURL
$handle = curl_init();
$url = "http://mobicomm.dove-sms.com//submitsms.jsp?user=WEB3CRE&key=105f3afe61XX&mobile=+91$mobile&message=Dear%20Customer%20please%20use%20OTP%20$msg%20for%20authentication.%20Thank%20you%20for%20registering%20for%20WorkLelo%20Team%20WorkLelo%20omkarent&senderid=OENTER&accusage=1&entityid=1401487200000053882&tempid=1407168577176506211";

curl_setopt($handle, CURLOPT_URL, $url);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);

$output = curl_exec($handle);
curl_close($handle);

// Return JSON response
echo json_encode([
    "code" => "200",
    "msg" => "Sent"
]);
?>
