duanbishai5271 2010-01-26 13:50
浏览 36
已采纳

通过https从Dropbox中删除PHP中的图像

I have a strange situation with PHP working differently from HTML. I'm not a web programmer, just messing around. In HTML my images appear fine, in PHP the images are broken. And only public images from my Dropbox https server are broken, ones from a http server work.

As an example, here are two files on my localhost, abc.html and def.php. They try to display two images, one pointing to my https image, and another pointing to the Google logo.

abc.html:

<img src='https://photos-1.dropbox.com/i/l/EyvpAUN99vGCmWKqw-ywSYXY1L8dPhkloKA5i9I--NM'>
<img src='http://www.google.co.uk/intl/en_uk/images/logo.gif'>

def.php:

<?php
echo "<img src='https://photos-1.dropbox.com/i/l/EyvpAUN99vGCmWKqw-ywSYXY1L8dPhkloKA5i9I--NM'>";
echo "<img src='http://www.google.co.uk/intl/en_uk/images/logo.gif'>";
exit;

Browsing to abc.html shows both images perfectly. Browsing to def.php only shows the Google logo and the other image is broken.

It doesn't work on Firefox however someone told me it works on Opera.

Ideas please :)


Edit: def.php outputs this:

<img src='https://photos-1.dropbox.com/i/l/EyvpAUN99vGCmWKqw-ywSYXY1L8dPhkloKA5i9I--NM'><img src='http://www.google.co.uk/intl/en_uk/images/logo.gif'>
  • 写回答

5条回答 默认 最新

  • dp0518 2010-01-26 14:16
    关注

    I'd recommend installing FireBug to see what the return response from the server is. You might find that DropBox is refusing to serve requests for images with referrals from files ending with certain extensions, e.g. .php.

    This might explain the duplicate behaviour with the plain HTTP too.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥20 求计算赫斯特(Hurst)指数
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大