Advertisement
Guest User

Untitled

a guest
May 19th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. $userinput = 'https://userarea.sms-assistent.by/api/v1/send_sms/plain?user='. $this->config['SMS_login'] .'&password='. $this->config['SMS_password'] . '&recipient='. $phone .'&message='. urlencode(str_replace('_', ' ', $msg)) . $from;
  2. //$ch = curl_init($userinput);
  3.  
  4. $uagent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)";
  5. $ch = curl_init( $userinput );
  6. curl_setopt($ch, CURLOPT_URL, $userinput);
  7. curl_setopt($ch, CURLOPT_USERAGENT, $uagent); // useragent
  8. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  9. curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
  10. curl_setopt($ch, CURLOPT_POST, 1);
  11. curl_setopt($ch, CURLOPT_TIMEOUT, 1);
  12. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  13. $header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,";
  14. $header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
  15. $header[] = "Content-Type: text/xml";
  16. $header[] = "Cache-Control: max-age=0";
  17. $header[] = "Connection: keep-alive";
  18. $header[] = "Keep-Alive: 300";
  19. $header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
  20. $header[] = "Accept-Language: en-us,en;q=0.5";
  21. $header[] = "Pragma: "; // browsers keep this blank.
  22. curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
  23. $content = curl_exec( $ch );
  24. $err = curl_errno( $ch );
  25. $errmsg = curl_error( $ch );
  26. $header = curl_getinfo( $ch );
  27. curl_close( $ch );
  28. $header['errno'] = $err;
  29. $header['errmsg'] = $errmsg;
  30. $header['content'] = $content;
  31. return $header;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement