Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_GET['link'])){
- $link = $_GET['link'];
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL,$link);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
- curl_setopt($ch, CURLOPT_NOBODY, 1);
- curl_setopt($ch, CURLOPT_FAILONERROR, 1);
- curl_setopt($ch, CURLOPT_HEADER, false);
- $server_output = curl_exec ($ch);
- header('Content-Type: application/json');
- print_r(json_encode(curl_getinfo($ch)));
- curl_close($ch);
- //print_r($server_output);
- }else{
- die("A url is needed");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement