SHARE
TWEET

Untitled

a guest Jun 27th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. class SMSModel extends CI_Model{
  3.   public function sendSMS($body,$telephone){
  4.         $userkey = "x3ia45";
  5.         $passkey = "2cg9z7e2oc";
  6.         $telepon = "$telephone";
  7.         $message = "$body";
  8.         $url = "https://reguler.zenziva.net/apps/smsapi.php";
  9.         $curlHandle = curl_init();
  10.         curl_setopt($curlHandle, CURLOPT_URL, $url);
  11.         curl_setopt($curlHandle, CURLOPT_POSTFIELDS, 'userkey='.$userkey.'&passkey='.$passkey.'&nohp='.$telepon.'&pesan='.urlencode($message));
  12.         curl_setopt($curlHandle, CURLOPT_HEADER, 0);
  13.         curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, 1);
  14.         curl_setopt($curlHandle, CURLOPT_SSL_VERIFYHOST, 2);
  15.         curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, 0);
  16.         curl_setopt($curlHandle, CURLOPT_TIMEOUT,30);
  17.         curl_setopt($curlHandle, CURLOPT_POST, 1);
  18.         $results = curl_exec($curlHandle);
  19.         curl_close($curlHandle);
  20.         $XMLdata = new SimpleXMLElement($results);
  21.         $status = $XMLdata->message[0]->text;
  22.         return $status;
  23.   }
  24. }
  25. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top