<?php
//if ($_SERVER["REQUEST_METHOD"] == "POST") {
    //$mobile = $_POST['mobile'];
    //$message = $_POST['message'];
    $mobile = "+94776271929";
  $message = "new test";

    $url = "https://sms.airtel.lk:5001/sms/send_sms.php";
    $username = 'ath1';
    $password = '@Nura1958';
    $src = 'A.T.H';

    $data = array(
        'username' => $username,
        'password' => $password,
        'src' => $src,
        'dst' => $mobile,
        'msg' => $message,
        'dr' => 1
    );

    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $response = curl_exec($ch);
    if (curl_errno($ch)) {
    echo 'cURL error: ' . curl_error($ch);
} else {
    // Output the response from the server
    echo 'Response from server: ' . $response;
}
    curl_close($ch);

    echo $response;
//}
?>
