Advertisement
psycholyzern

Untitled

Jul 24th, 2015
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. if(isset($_GET['link'])){
  5.   $link = $_GET['link'];
  6.  
  7. $ch = curl_init();
  8. curl_setopt($ch, CURLOPT_URL,$link);
  9. curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
  10. curl_setopt($ch, CURLOPT_NOBODY, 1);
  11. curl_setopt($ch, CURLOPT_FAILONERROR, 1);
  12. curl_setopt($ch, CURLOPT_HEADER, false);
  13. $server_output = curl_exec ($ch);
  14. header('Content-Type: application/json');
  15. print_r(json_encode(curl_getinfo($ch)));
  16. curl_close($ch);
  17. //print_r($server_output);
  18. }else{
  19.   die("A url is needed");
  20. }
  21.  
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement