Advertisement
Zacharee1

PHPSTUFF

Jun 17th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. <?php
  2.  
  3. $curl = curl_init();
  4.  
  5. // Set url
  6. curl_setopt($ch, CURLOPT_URL, 'https://xpw1.no-ip.org:8443/server/console');
  7.  
  8. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  9.  
  10. // Set method
  11. curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
  12.  
  13. // Set options
  14. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  15.  
  16. // Set headers
  17. curl_setopt($ch, CURLOPT_HTTPHEADER, [
  18.   "X-Access-Server: <PRIVATE>",
  19.   "X-Access-Token: <PRIVATE>",
  20.  ]
  21. );
  22.  
  23. $response = curl_exec($curl);
  24. $err = curl_error($curl);
  25.  
  26. curl_close($curl);
  27.  
  28. if ($err) {
  29.   echo "cURL Error #:" . $err;
  30. } else {
  31.   echo $response;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement