Nowadays, many websites and forums use anti-hotlinking technology for pictures. Since there is anti-hotlinking, there must be a way to crack anti-hotlinking. Below, the editor will provide you with a way to crack anti-hotlinking pictures. php function. However, it only supports jpg and gif. If you want to support multiple image formats, you can make modifications.
$url=$_GET['url'];
$ext=pathinfo($url,PATHINFO_EXTENSION);
if($ext!='jpg' && $ext!='gif'){ // Only supports jpg and gif
readfile('/upload/20081209130557536.gif');
exit;
}
$file=md5($url).'.'.$ext;
if(file_exists($file)){
readfile($file);
exit;
}else{
$data=file_get_contents($url);
if(!$data){ // Failed to read
readfile('/upload/20081209130557536.gif');
exit;
}
$handle=fopen($file,'wb');
fwrite($handle,$data);
fclose($handle);
echo $data;
}
?>