Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2.  
  3. $username = 'xx@.com';
  4. $password = 'password';
  5. $url = 'https://xxx.mybigcommerce.com';
  6. $product_url = $url.'/api/v2/products.json?category=243&is_visible=true';
  7.  
  8. $curl = curl_init();
  9. curl_setopt($curl, CURLOPT_URL, $product_url);
  10. curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
  11. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  12. curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  13. curl_setopt($curl, CURLOPT_USERPWD, $username . ":" . $password);
  14. curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
  15. curl_setopt($curl, CURLOPT_ENCODING, "");
  16. $curlProductData = curl_exec($curl);
  17. curl_close($curl);
  18. echo $curlProductData;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement