Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $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;
- //$ch = curl_init($userinput);
- $uagent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)";
- $ch = curl_init( $userinput );
- curl_setopt($ch, CURLOPT_URL, $userinput);
- curl_setopt($ch, CURLOPT_USERAGENT, $uagent); // useragent
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_TIMEOUT, 1);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- $header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,";
- $header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
- $header[] = "Content-Type: text/xml";
- $header[] = "Cache-Control: max-age=0";
- $header[] = "Connection: keep-alive";
- $header[] = "Keep-Alive: 300";
- $header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
- $header[] = "Accept-Language: en-us,en;q=0.5";
- $header[] = "Pragma: "; // browsers keep this blank.
- curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
- $content = curl_exec( $ch );
- $err = curl_errno( $ch );
- $errmsg = curl_error( $ch );
- $header = curl_getinfo( $ch );
- curl_close( $ch );
- $header['errno'] = $err;
- $header['errmsg'] = $errmsg;
- $header['content'] = $content;
- return $header;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement