if(@$_REQUEST['url'] && checkImage())
{
$url = trim($_REQUEST['url']);
$ch = curl_init($url);
curl_setopt($ch,CURLOPT_NOBODY,1);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_HEADER,1);
$c = curl_exec($ch);
curl_close($ch);
if(!$c)
{
echo "
Sorry url not found!";
}
else
{
preg_match("#HTTP.*? (\\d+) #i",$c,$code);
$code = @$code[1];
preg_match("#Location:(.*)$#mi",$c,$location);
$location = trim(@$location[1]);
echo "
";
if($code==301)
{
echo "This website has a 301 Redirect to:
$location
This redirect is Search Engine Friendly.";
}
elseif($code==302)
{
echo "This website returned a 302 which is either not search engine friendly or a redirect.";
}
else
{
echo "This website returned a $code which is search engine friendly.";
}
}
}
?>