我用cur模拟登陆网站是,出现错误Object reference not set to an instance of an object.。
我用浏览器登陆时的post参数和我curl中参数时一样的,没问题。
我在代码中添加了 $D为cookies信息。
curl_setopt($curl, CURLOPT_COOKIE, $D);
因为需要验证码登陆。
但是模拟登陆中头信息中缺少了
cookies。
我想是不是这个问题?设置了头信息的cookie为什么没有了。
Date: Sun, 17 May 2015 03:34:19 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Cache-Control: private
Content-Type: text/html; charset=gb2312
Content-Length: 594