Home  >  Article  >  Backend Development  >  PHP function to crack anti-hotlink images_PHP tutorial

PHP function to crack anti-hotlink images_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 14:51:49840browse

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;

 }

 ?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/371750.htmlTechArticleMany websites and forums are now using anti-hotlinking technology in their pictures. Since there is anti-hotlinking, there must be a crack. How to prevent hotlinking, the editor below will provide you with a crack to prevent theft...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn