Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class SMSModel extends CI_Model{
- public function sendSMS($body,$telephone){
- $userkey = "x3ia45";
- $passkey = "2cg9z7e2oc";
- $telepon = "$telephone";
- $message = "$body";
- $url = "https://reguler.zenziva.net/apps/smsapi.php";
- $curlHandle = curl_init();
- curl_setopt($curlHandle, CURLOPT_URL, $url);
- curl_setopt($curlHandle, CURLOPT_POSTFIELDS, 'userkey='.$userkey.'&passkey='.$passkey.'&nohp='.$telepon.'&pesan='.urlencode($message));
- curl_setopt($curlHandle, CURLOPT_HEADER, 0);
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($curlHandle, CURLOPT_SSL_VERIFYHOST, 2);
- curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($curlHandle, CURLOPT_TIMEOUT,30);
- curl_setopt($curlHandle, CURLOPT_POST, 1);
- $results = curl_exec($curlHandle);
- curl_close($curlHandle);
- $XMLdata = new SimpleXMLElement($results);
- $status = $XMLdata->message[0]->text;
- return $status;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement