我是靠谱客的博主 雪白御姐,这篇文章主要介绍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;
}
?>

最后

以上就是雪白御姐最近收集整理的关于php 破解防盗链图片函数的全部内容,更多相关php内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(258)

评论列表共有 0 条评论

立即
投稿
返回
顶部