给看下那里有错,
//防止乱码
header("Content-type:text/html;charset=UTF-8");
$discuz_url = 'http://www.uuxoo.com/ ';//地址
//$login_url = $discuz_url .'/violat/query/';//地址
$url="http://www.uuxoo.com/violat/query/";
//$cookie_file = tempnam('./temp','cookie');
$ch = curl_init($url);
//echo $login_url;
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
$contents = curl_exec($ch);
curl_close($ch);
//获取表单FORMHASH
preg_match('//i', $contents, $matches);
if(!empty($matches)) {
$formhash = $matches[1];
} else {
die('Not found the forumhash.');
}
//?vehicle_reg_no=E1Y121&vehicle_id_no=153313&have_submit=yes&submit=1&vehicle_area=赣&vehicle_type=02
$post_data = array();
//车牌号
$post_data['vehicle_reg_no'] = 'E1Y121';
//车架号
$post_data['vehicle_id_no'] = '153313';
$post_data['have_submit'] = "yes";
$post_data['submit'] = '1';
//汽车地址
$post_data['vehicle_area'] = '赣';
//帖子的hash码,这个非常关键!假如缺少这个hash码,discuz会警告你来路的页面不正确
$post_data['formhash']=$formhash;
//汽车类型
$post_data['vehicle_type'] = '02';
$aaa= $formhash;
echo $aaa;
//$urlss="http://www.uuxoo.com/violat/query/?vehicle_reg_no=E1Y121&formhash=$aaa&vehicle_id_no=153313&have_submit=yes&submit=1&vehicle_area=赣&vehicle_type=02";
//echo $urlss;
$chs = curl_init($url);
//curl_setopt($ch, CURLOPT_REFERER, $url); //伪装REFERER
curl_setopt($chs, CURLOPT_HEADER, 0);
curl_setopt($chs, CURLOPT_RETURNTRANSFER, 1);
//curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
//curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt($chs, CURLOPT_POST, 1);
curl_setopt($chs, CURLOPT_POSTFIELDS, $post_data);
echo curl_exec($chs);
//echo "$ch";
curl_close($chs);
?>
0
0
Curl
相关文章
ini_set()在PHP中的作用是什么?
在PHP中的readlink()函数
我们如何编写PHP脚本来释放与MySQL结果关联的游标内存?
PHP intdiv() 函数
我们如何使用PHP脚本删除MySQL数据库?
相关标签:
本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门AI工具
相关专题
Java Spring Boot 微服务实战
本专题深入讲解 Java Spring Boot 在微服务架构中的应用,内容涵盖服务注册与发现、REST API开发、配置中心、负载均衡、熔断与限流、日志与监控。通过实际项目案例(如电商订单系统),帮助开发者掌握 从单体应用迁移到高可用微服务系统的完整流程与实战能力。
1
2025.12.24
热门下载
网站特效
/
网站源码
/
网站素材
/
前端模板
精品课程
相关推荐
/
热门推荐
/
最新课程
PHP使用CURL抓取页面
共4课时 | 2.9万人学习
前端最全HTTP基础原理及应用
共12课时 | 1.7万人学习
最新文章








