Advertisement
Luit

Untitled

Apr 25th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. <?
  2. header('Access-Control-Allow-Origin: *');  
  3. if(isset($_GET['url'])) {
  4.     $ch = curl_init();
  5.     curl_setopt($ch, CURLOPT_URL, $_GET['url']);
  6.     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  7.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  8.     curl_exec($ch);
  9.     if(in_array(substr(get_headers(curl_getinfo($ch, CURLINFO_EFFECTIVE_URL))[0], 9, 3),array("100","101","200","201","202","301","302","307","308"))){
  10.         echo 1;
  11.     }else{
  12.         echo 0;
  13.     }
  14. }
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement