时间:2021-07-01 10:21:17 帮助过:8人阅读
header("content-Type: text/html; charset=utf-8");$username = "user";$password = "pw";$verifyCode = "";$remeber = "";$curlPost = 'username='.urlencode($username).'&passwd='.urlencode($password).'&verifyCode='.urlencode($verifyCode).'&remeber='.urlencode($remeber);$ch = curl_init();//初始化curlcurl_setopt($ch,CURLOPT_URL,'http://zhanzhang.cnzz.com/login.php');//抓取指定网页curl_setopt($ch, CURLOPT_HEADER, 0);//设置headercurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);//设置自动跳转curl_setopt($ch, CURLOPT_AUTOREFERER, 1); // 自动设置referercurl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); // 模拟用户使用的浏览器curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);//要求结果为字符串且输出到屏幕上curl_setopt($ch, CURLOPT_POST, 1);//post提交方式curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);curl_exec($ch);//运行curl//curl_setopt($ch, CURLOPT_REFERER, 'http://new.cnzz.com/v1/main.php?s=site_list');curl_close($ch);
我最近也要做这个,不知道你的做完了没,能不能发给我一份呀393978119@qq.com