Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. <?php
  2.  
  3. $data = [
  4.   'username' => "admin",
  5.   'password' => "xxxxxxxx",
  6.   'sender' => "SMSALERT",
  7.   'receiver' => "22589123989",
  8.   'content' => "Hello World!"
  9. ];
  10.  
  11.  
  12. $curl = curl_init();
  13.  
  14. curl_setopt_array($curl, array(
  15.   CURLOPT_URL => "https://gateway3.arolitec.com/interface/sendSMS_HTTPS_POST.php",
  16.   CURLOPT_SSL_VERIFYPEER => 0,
  17.   CURLOPT_RETURNTRANSFER => true,
  18.   CURLOPT_ENCODING => "",
  19.   CURLOPT_MAXREDIRS => 10,
  20.   CURLOPT_TIMEOUT => 30,
  21.   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  22.   CURLOPT_CUSTOMREQUEST => "POST",
  23.   CURLOPT_POSTFIELDS => $data,
  24.   CURLOPT_HTTPHEADER => array(
  25.     "cache-control: no-cache",
  26.   ),
  27. ));
  28.  
  29. $response = curl_exec($curl);
  30. $err = curl_error($curl);
  31.  
  32. curl_close($curl);
  33.  
  34. if ($err) {
  35.   echo "cURL Error #:" . $err;
  36. } else {
  37.   echo $response;
  38. }
  39.  
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement