php - trouble of show http image in https -
i need embed http image in https website, because if use <img src="http://www.sof.com/abc.jpg"/>
not show in https website.
after that, search topic of function, found <img src="https://www.some.com/image.php?url=http://www.sof.com/abc.jpg" />
can show in https
so genarate 2 source. 1 image file: http://www.website1.com/abc.png
,
and https web adress https://fb.ccc.com
after create image.php code below:
<? $strfile = base64_decode(@$_get['url']); $strfileext = end(explode('.' , $strfile)); if($strfileext == 'jpg' or $strfileext == 'jpeg'){ header('content-type: image/jpeg'); }elseif($strfileext == 'png'){ header('content-type: image/png'); }elseif($strfileext == 'gif'){ header('content-type: image/gif'); }else{ die('not supported'); } if($strfile != ''){ $cache_expire = 60*60*24*365; header("pragma: public"); header("cache-control: maxage=". $cache_expire); header('expires: ' . gmdate('d, d m y h:i:s', time() + $cache_expire).' gmt'); } exit; ?>
if request link: https://fb.ccc.com/image.php?url=http://www.website1.com/abc.png , page respone not supported
i try $strfile = $_get['url'];
show blank. if try $strfile = var_dump(@$_get['url']);
, page respone string(31) "http://www.website1.com/abc.png" not supported
so can find out script problem?
thank much!
Comments
Post a Comment