1 |
|
1 |
|
1 |
|
echo curl_exec($ch);
另外你的2.php是跳转了,并没有返回内容。
改成echo file_get_contnets('location:http://bbs.csdn.net'); 试试
header('location:http://bbs.csdn.net');
形成的 http 头
HTTP/1.1 302 Found
Date: Wed, 26 Feb 2014 09:16:38 GMT
location: http://bbs.csdn.net
Content-Length: 0
Content-Type: text/html;Charset=utf-8
你不跟着跳转吗?
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
header('location:http://bbs.csdn.net');
形成的 http 头
HTTP/1.1 302 Found
Date: Wed, 26 Feb 2014 09:16:38 GMT
location: http://bbs.csdn.net
Content-Length: 0
Content-Type: text/html;Charset=utf-8
你不跟着跳转吗?
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
谢谢斑竹的帮忙 我改成了这样
1.php
1 |
|
1 |
|
#1 不是说了吗?
echo curl_exec($ch);
你不输出结果怎么能行?
nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
谢谢大家的帮忙