<?php
require ("includes/check_auth_user.php");
require ("includes/dbconnect.php");
include ('includes/function.php');

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
//mysqli_select_db($conn, $zdb);

//if (isset($_POST["submit"])) {


    $message = $_REQUEST["sms"];
    $mobileno = $_REQUEST["mobileno"];
    
//      browse($message);
//    browse($mobileno);


    $curl = curl_init();

    curl_setopt_array($curl, array(
        CURLOPT_URL => 'https://app.rapbooster.com/api/sendMsg',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_ENCODING => '',
        CURLOPT_MAXREDIRS => 10,
        CURLOPT_TIMEOUT => 0,
        CURLOPT_FOLLOWLOCATION => true,
        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        CURLOPT_CUSTOMREQUEST => 'POST',
        CURLOPT_POSTFIELDS => array('apiAuthkey' => '6a9f4ac6eda804fb0ab6', 'msg' => "$message", 'receiverMobile' => "91$mobileno"),
    ));

    $response = curl_exec($curl);
    print $response;

    curl_close($curl);
    echo $response;



//    echo "<script>
//            parent.window.location.reload();
//            </script>";
//}
?>
    
