Cross domain file check

$imgfile="<a href="http://www.crossdomain.com/image.jpg";" >http://www.crossdomain.com/image.jpg";</a>
try
{
	$k=@file_get_contents($imgfile);

} catch (Exception $e) {
	$k=false;
}

if($k!=false)
{
	$result .= "<img src='$imgfile'>";
	
}
else
{
	$result.="no image file";
}

source

Comments are closed.