Sebuahhobi98

zenziva_new_line

Sep 24th, 2019
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.08 KB | None | 0 0
  1. private function sms($telepon = '', $message = ''){
  2.         $this->output->set_content_type('application/json');
  3.         $userkey = "3ifvmw";
  4.         $passkey = "85evefuhgm";
  5.         $url = "https://reguler.zenziva.net/apps/smsapi.php";
  6.         $curlHandle = curl_init();
  7.         curl_setopt($curlHandle, CURLOPT_URL, $url);
  8.         curl_setopt($curlHandle, CURLOPT_POSTFIELDS, 'userkey='.$userkey.'&passkey='.$passkey.'&nohp='.$telepon.'&pesan='.$message);
  9.         curl_setopt($curlHandle, CURLOPT_HEADER, 0);
  10.         curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, 1);
  11.         curl_setopt($curlHandle, CURLOPT_SSL_VERIFYHOST, 2);
  12.         curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, 0);
  13.         curl_setopt($curlHandle, CURLOPT_TIMEOUT,30);
  14.         curl_setopt($curlHandle, CURLOPT_POST, 1);
  15.         $results = curl_exec($curlHandle);
  16.         curl_close($curlHandle);
  17.         $XMLdata = new SimpleXMLElement($results);
  18.         $status = $XMLdata->message[0]->text;
  19.         //echo json_encode($XMLdata);
  20.         return $XMLdata;
  21.     }
  22.  
  23. $this->data['pesan'] = "Cacing%20dalam%20bahaya!%0A
  24. pH = ".$ph."
  25. ".$this->data['signature'];
  26. $this->data['sendSMS'] = $this->sms('08xx', $this->data['pesan']);
Add Comment
Please, Sign In to add comment