0
<?php
@$test = $GET['link'];
$url = 'http://cf3.fancyimgs.com/310/20130521/367302239598940361_92b5e3190b3f.jpg';
$ch = curl_init($test);
$fc = fopen('c.jpg', 'w+');
curl_setopt($ch, CURLOPT_FILE, $fc);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fc);
?>

这在codeigniter中不起作用,上面是我的php代码,用于从我通过GET传递的url获取图像并且没有从get请求url获取图像有人可以帮我解决这个问题.....下面是我发送图片网址的链接

<a href="index.php?link=<?php echo $url ;?>">click to download</a>
4

1 回答 1

3

它应该是

$_GET['link']
 ^
 |--- Note the underline 

不是

$GET['link']

echo urlencode($url) // would be better approach ... 
于 2013-05-29T11:05:59.993 回答