返回信息流我做得一个小网站需要链接豆瓣网站的图片,结果发现图片加了防盗链,我这边全挂,不知道怎么解决?求助各位大神
这是一条镜像帖。来源:北邮人论坛 / www-technology / #28245同步于 2014/11/15
该镜像源已超过 30 天没有更新,可能在源站已被删除。
WWWTechnology机器人发帖
[问题]【求助】怎么处理豆瓣防盗链的图片
bianbianya
2014/11/15镜像同步8 回复
订阅后,新回复会通过你的通知中心匿名送达。
8 条回复
【 在 fenglingxue 的大作中提到: 】
: 怎么搞
: 我做得一个小网站需要链接豆瓣网站的图片,结果发现图片加...
写一个showpic.php:
<?php
$picurl = stripcslashes($_REQUEST["picurl"]);
$content = file_get_contents($picurl);
header("Content-Type: image/jpg; charset=UTF-8");
echo $content;
?>
然后把图片链接传过来,比如你要显示就这样写<img src="http://localhost/showpic.php?picurl=http://img3.douban.com.2342342.jpg" >
【 在 nullne 的大作中提到: 】
: 怎么搞?
写一个showpic.php:
<?php
$picurl = stripcslashes($_REQUEST["picurl"]);
$content = file_get_contents($picurl);
header("Content-Type: image/jpg; charset=UTF-8");
echo $content;
?>
然后把图片链接传过来,比如你要显示就这样写<img src="http://localhost/showpic.php?picurl=http://img3.douban.com.2342342.jpg" >