Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $login = 'InternetWDS';
- $password = 'hm7PdQdapzkv';
- $to = '380671098211';
- $body = 'KremenetsWDS http://www.kwds.net.ua; user:bormak password:1128901';
- $answ = post_request('https://api.life.com.ua/ip2sms/', $login, $password, $to, $body);
- echo $answ;
- function post_request($url, $login, $pwd, $to, $body)
- {
- $params = array('http' =>
- array(
- 'method' => 'POST',
- 'header' => array('Authorization: Basic ' . base64_encode($login.":".$pwd),
- 'Content-Type: text/xml'),
- 'content' => "<message><service id='single' source='InternetWDS'/><to>".$to."</to><body content-type='text/plain'>".$body."</body></message>"
- ));
- var_dump ($params);
- $ctx = stream_context_create($params);
- $fp=@fopen($url, 'rb', FALSE, $ctx);
- if ($fp) {
- $response = @stream_get_contents($fp);
- return $response;
- }else{
- return FALSE;
- }
- }
- exit;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement