直接贴代码
$ch = curl_init('http://www.baidu.com');
$a = curl_setopt($ch, CURLOPT_COOKIE, 'name=houming');
$b = curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$error = curl_error($ch);
var_dump($a,$b,$error);返回结果:
bool(false) bool(true) string(0) ""
回复内容:
直接贴代码
$ch = curl_init('http://www.baidu.com');
$a = curl_setopt($ch, CURLOPT_COOKIE, 'name=houming');
$b = curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$error = curl_error($ch);
var_dump($a,$b,$error);返回结果:
bool(false) bool(true) string(0) ""
curl_error($ch);
看下什么错误,我这边执行你的代码是TRUE
如果上面的不行,可以用下面的方法
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Cookie: name=houming"))










