Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- header('Access-Control-Allow-Origin: *');
- if(isset($_GET['url'])) {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $_GET['url']);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_exec($ch);
- 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"))){
- echo 1;
- }else{
- echo 0;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement