PHP头条
热点:

php破解防盗链图片函数


代码如下:
$url=$_GET['url'];
$ext=pathinfo($url,PATHINFO_EXTENSION);
if($ext!='jpg' && $ext!='gif'){ // 只支持jpg和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){ // 读取失败
readfile('/upload/20081209130557536.gif');
exit;
}
$handle=fopen($file,'wb');
fwrite($handle,$data);
fclose($handle);
echo $data;
}
?>

www.phpzy.comtrue/phpyy/13481.htmlTechArticlephp破解防盗链图片函数 代码如下: $url=$_GET['url']; $ext=pathinfo($url,PATHINFO_EXTENSION); if($ext!='jpg' $ext!='gif'){ // 只支持jpg和gif readfile('/upload/20081209130557536.gif'); exit; } $file=md5($url).'.'.$ext; if(file_...

相关文章

相关频道:

PHP之友评论

今天推荐