Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, 'http://37.233.18.11:2639/ws_getstock?ranges=all');
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT ,0);
- curl_setopt($ch, CURLOPT_TIMEOUT, 300);
- //curl_setopt($ch, CURLOPT_USERPWD, '[onlineshop]:[onlineshop]');
- $username=$password='onlineshop';
- curl_setopt($ch, CURLOPT_HTTPHEADER,
- array(
- "Authorization: Basic " . base64_encode($username . ":" . $password)
- ));
- $data = curl_exec($ch);
- if(!curl_exec($ch)){
- die('Error: "' . curl_error($curl) . '" - Code: ' . curl_errno($ch));
- }
- file_put_contents(realpath('public').'/ws_getstock.xml',$data);
- curl_close($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement