高手指点:如何登陆到https,并将cookie发送过去 标记。只知道Apchache要启动https服务。form 提交到 https://url行不行? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我在网上找了几个类是的登陆程序,可是浏览器没有任何反映,我不知道是不是能用,我必须要登陆进去才行<?# script by Joel De Gan# http://listbid.comfunction GetCurlPage ($pageSpec) {//$agent = "up.b";//$agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";$agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";$header[] = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*";$ch = curl_init($pageSpec);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_VERBOSE, 1); ########### debugcurl_setopt($ch, CURLOPT_USERAGENT, $agent);curl_setopt ($ch, CURLOPT_HTTPHEADER, $header);curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);curl_setopt($ch, CURLOPT_COOKIEJAR, "cook");curl_setopt($ch, CURLOPT_COOKIEFILE, "cook");$tmp = curl_exec ($ch);curl_close ($ch);return $tmp;}function PostCurlPage ($pageSpec, $data){ $agent = "up.b"; $header[] = "Accept: text/vnd.wap.wml,*.*"; $ch = curl_init($pageSpec); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_VERBOSE, 1); ########### debug curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt ($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_COOKIEJAR, "cook"); curl_setopt($ch, CURLOPT_COOKIEFILE, "cook"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $tmp = curl_exec ($ch); curl_close ($ch); return $tmp;}//$first = GetCurlPage("https://www.paypal.com/cgi-bin/phscr?cmd=login"); $first = GetCurlPage("https://www.paypal.com");$exp = explode("=", $first);$id = explode("\"", $exp[16]);//$second = PostCurlPage("https://www.paypal.com/cgi-bin/phscr?rs=".$id[0], "[email protected]&pass=YOUR_PP_PASS&cmd=login-submit-pass");//echo $second."\n\n";?> 你在传递COOKIE时标记secure参数了吗?int SetCookie(string name, string value, int expire, string path, string domain, int secure); 除了name之外所有的参数都是可选的。value,path,domain三个参数可以用空字符串代换,表示没有设置;expire 和 secure两个参数是数值型的,可以用0表示。expire参数是一个标准的Unix时间标记,可以用time()或mktime()函数取得,以秒为单位。secure参数表示这个Cookie是否通过加密的HTTPS协议在网络上传输。 有一个PHP的MYSQL语句的请教,希望大家帮忙! x_debug 一个简单小问题 请教将现有的系统改成面向对象的思路 今天开始学习PHP 来报个到 呵呵 winxp 下开发PHP环境的配置,用的是apache,php,mysql,请问高人,如果配置? 请教一个Form能不能象两个表单里面提交内容啊 缓存 缓存 缓存 PHP缓存疑问 有办法把一些 PHP的变量放到内存里面共享的么 关于生成图片缩略图的神秘问题-_-!! php网站显示空白的问题! 请高手指点 寻求合作者开发一套网络论坛,有兴趣的朋友进来看一下
我不知道是不是能用,我必须要登陆进去才行
<?
# script by Joel De Gan
# http://listbid.comfunction GetCurlPage ($pageSpec) {//$agent = "up.b";
//$agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
$agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
$header[] = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*";
$ch = curl_init($pageSpec);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1); ########### debug
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt ($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cook");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cook");
$tmp = curl_exec ($ch);
curl_close ($ch);
return $tmp;
}
function PostCurlPage ($pageSpec, $data)
{
$agent = "up.b";
$header[] = "Accept: text/vnd.wap.wml,*.*";
$ch = curl_init($pageSpec);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1); ########### debug
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt ($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cook");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cook");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$tmp = curl_exec ($ch);
curl_close ($ch);
return $tmp;
}//$first = GetCurlPage("https://www.paypal.com/cgi-bin/phscr?cmd=login");
$first = GetCurlPage("https://www.paypal.com");
$exp = explode("=", $first);
$id = explode("\"", $exp[16]);
//$second = PostCurlPage("https://www.paypal.com/cgi-bin/phscr?rs=".$id[0], "[email protected]&pass=YOUR_PP_PASS&cmd=login-submit-pass");
//echo $second."\n\n";
?>
除了name之外所有的参数都是可选的。value,path,domain三个参数可以用空字符串代换,表示没有设置;expire 和 secure两个参数是数值型的,可以用0表示。expire参数是一个标准的Unix时间标记,可以用time()或mktime()函数取得,以秒为单位。secure参数表示这个Cookie是否通过加密的HTTPS协议在网络上传输。