$ch = curl_init( );
$headers_login = array(
'Host' => 'mail.10086.cn',
'User-Agent' => 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; MS-RTC LM 8; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; CIBA)',
'Accept' => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*',
'Accept_Language' => 'zh-cn',
'Accept_Encoding' => 'gzip,deflate',
// 'Accept_Charset' => 'GB2312,utf-8;q=0.7,*;q=0.7\r\n',
// 'Keep-Alive' => '115',
'Connection' => 'keep-alive',
'Content-Length' => '50',
'Content-Type' => 'application/x-www-form-urlencoded',
// 'X-Requested-With'=> 'XMLHttpRequest',
'Content_Type' => 'application/x-www-form-urlencoded',
'Cache-Control' => 'no-cache',
'Referer' => 'http://mail.10086.cn/'
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers_login);
curl_setopt($ch,CURLOPT_HEADER,1);
curl_setopt( $ch, CURLOPT_URL, "https://mail.10086.cn/Login/Login.ashx" );
// curl_setopt( $ch, CURLOPT_USERAGENT, USERAGENT );
curl_setopt( $ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt( $ch, CURLOPT_COOKIEJAR, COOKIEJAR );
curl_setopt( $ch, CURLOPT_TIMEOUT, TIMEOUT );
$fileds = "UserName=null&Password=null";
$fileds .= "&VerifyCode";
curl_setopt( $ch, CURLOPT_POSTFIELDS, $fileds );
ob_start( );
curl_exec( $ch );
$str = curl_exec($ch);
echo $str;exit;
$result = ob_get_contents( );
ob_end_clean( );
curl_close( $ch );
我想模拟登录来发发短信 查查话费
@ 各位大神帮帮忙
{"code":"S_OK","summary":"成功","var":{"tipsMsg":"您当前可用余额<span class=\"numColor\">1元</span>,月手机流量共<span class=\"numColor\">0.00M</span>,已使用<span class=\"numColor\">0.00M</span>,剩余<span class=\"numColor\">0.00M</span>。以上信息仅供参考","packageName":"立即充值","packageUrl":"javascript:top.$App.show('billCharge',{ct:'main',ac:'phonefeecharge'});top.BH({actionId:105520, thingId:2, moduleId:25,pageId:24});","tipsName":"查看详情","tipsUrl":"javascript:top.$App.show('billCharge',{ct:'main',ac:'index'});top.BH({actionId:105520, thingId:1, moduleId:25,pageId:24});","balance":"1"}}
HTTP/1.1 302 Found
Server: nginx
Date: Mon, 02 Feb 2015 05:53:26 GMT
Content-Length: 0
Connection: keep-alive
Set-Cookie: a_l=;Path=/;Domain=mail.10086.cn;expires=Mon Feb 02 13:53:26 CST 2015;Max-Age=0
Set-Cookie: a_l2=;Path=/;Domain=mail.10086.cn;expires=Mon Feb 02 13:53:26 CST 2015;Max-Age=0;HTTPOnly
Set-Cookie: PICTUREUIN=WyNmglZCCCherg2AGkwwcft;Path=/;Domain=mail.10086.cn;HTTPOnly
Set-Cookie: PICTURELOGIN=YTkzODYwMTZmZjI1ODA3Nzk2YjY0ZDE4YzYzMmUxOXwxMDQxNDIzNTYxfDE0MjI4NTY0MDY3MTB8UklDSElORk84ODg=;Path=/;Domain=mail.10086.cn;HTTPOnly
Location: http://mail.10086.cn/webmail/imgverify/index.html?&m=0&u=YWl4aWFvem91&s=&ec=S025&cguid=1353000269340&mtime=45