Acest site foloseşte cookies. Continuarea navigării pe acest site reprezintă acordul dumneavoastră pentru folosirea cookie-urilor. Aflaţi mai multe sau Inchideţi notificarea
Intrebari Frecvente - Despre noi - Parteneri - Platforma mobila de SMS marketing - Blog - Contact / Support    
<?php 

// -------------------------------------------------------------------------------------------
//     Populate $RequestData
// -------------------------------------------------------------------------------------------
$RequestData = array(
        
"connection_id" => "",                // SMS Gateway Connection ID
        
"password"      => "",                // SMS Gateway Password
        
"to"            => "0723123456",      // Receiver of SMS
        
"message"       => "Test SMS",        // Message of SMS
    
);

// -------------------------------------------------------------------------------------------
//     Create a CURL JSON POST Request
// -------------------------------------------------------------------------------------------
$ch curl_init();

curl_setopt($chCURLOPT_URL"http://www.smslink.ro/sms/gateway/communicate/json.php");

curl_setopt($chCURLOPT_POSTtrue);
curl_setopt($chCURLOPT_FOLLOWLOCATION1);
curl_setopt($chCURLOPT_HEADER0);
curl_setopt($chCURLOPT_HTTPHEADER
        array(
'Content-Type: application/json')
    );

curl_setopt($chCURLOPT_RETURNTRANSFER1);

// -------------------------------------------------------------------------------------------
//     For increased performance, we recommend setting CURLOPT_SSL_VERIFYPEER and 
//   CURLOPT_SSL_VERIFYHOST to false, as in implementation below.
// -------------------------------------------------------------------------------------------
if (strpos(URL"https://") !== false)
{
    
curl_setopt($chCURLOPT_SSL_VERIFYPEERfalse);
    
curl_setopt($chCURLOPT_SSL_VERIFYHOSTfalse);
}

curl_setopt($chCURLOPT_POSTFIELDSjson_encode($RequestData));

$ResultData json_decode(curl_exec($ch), true);

curl_close($ch);

// -------------------------------------------------------------------------------------------
//     Process Response
// -------------------------------------------------------------------------------------------
print_r($ResultData);

?>