ttt8com
中级会员
 
中级会员
UID 14544
精华
0
积分 262
帖子 256
金钱 262 喜悦币
威望 0
人脉 0
阅读权限 30
注册 2002-5-27
状态 离线
|
[推荐阅读] 紧急,关于日期的,在线等
//CURL SSL POST 登陆PHPX 环境php5.2.4 extension=php_curl.dll
$url = "https://www.phpx.com/logging.php?action=login";
$fields = "formhash=2d47d0be&referer=http://www.phpx.com/happy/&cookietime=315360000&username=xxxxxxxx&password=xxxxxxxxxx&loginsubmit=提 交";
$cookie_file = "D:\phpcode\www\cookie.txt";
//登录
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
//写cookie
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
//curl_setopt($ch, CURLOPT_TIMEOUT, 6);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
curl_close($ch);
//echo $result;
//exit;
//登录成功操作
$url2 = "https://www.phpx.com/";
$ch2 = curl_init();
curl_setopt($ch2, CURLOPT_URL, $url2);
curl_setopt($ch2, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch2, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch2, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
//发送cookie
curl_setopt($ch2, CURLOPT_COOKIEFILE, $cookie_file);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER,1);
$result2 =curl_exec($ch2);
curl_close($ch2);
echo $result2;
|  QQ 922710 |
|