curl模拟post进行表单提交
来源:互联网 发布:怎么找淘宝卖家id 编辑:程序博客网 时间:2024/05/16 14:48
先模拟一个post提交
<?php
header("Content-type:text/html;charset=utf-8");$stuid = "201301013";
$pwd = "136";
$uri = "www.lihe.com/lihe/b.php";//这里换成你服务器的地址
// 参数数组
$data = array (
'stuid' => $stuid,
'pwd' => $pwd
);
$ch = curl_init (); //初始化curl
curl_setopt ( $ch, CURLOPT_URL, $uri );
curl_setopt ( $ch, CURLOPT_POST, 1 ); //使用post请求
curl_setopt ( $ch, CURLOPT_HEADER, 0 );
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt ( $ch, CURLOPT_POSTFIELDS, $data); //提交数据
curl_setopt ( $ch, CURLOPT_FOLLOWLOCATION, true); //重定向地址也输出
$return = curl_exec ( $ch ); //得到返回值
curl_close ( $ch ); //关闭
print_r($return); //输出返回值
b.php进行数据接收
<?php
$user = $_POST['stuid'];
$pwd = $_POST['pwd'];
print_r($user);die;
/*
这里对得到的数据进行处理
*/
echo "成功!"; //最后输出结果
?>
0 0
- curl模拟post进行表单提交
- PHP CURL模拟表单post提交文件,curl POST文件
- curl 模拟post 提交
- curl模拟post提交
- curl模拟post提交
- Linux下使用CURL模拟用户提交post表单
- PHP curl post提交表单
- curl 命令提交post表单
- 模拟post表单提交
- cURL模拟POST提交数据
- php curl 模拟post提交
- curl模拟post请求提交
- curl模拟post请求提交
- curl模拟post请求提交
- curl模拟post请求提交
- curl模拟post请求提交
- curl模拟提交(post)
- curl模拟post请求提交
- There are no resources that can be added or removed from the server. .
- 基于ARP的网络扫描工具netdiscover
- Solr学习总结(八)IK 中文分词的配置和使用
- java实现闰年
- C# 学习笔记 2
- curl模拟post进行表单提交
- ORA-01422: 实际返回的行数超出请求的行数
- java的IO方式
- 【TensorFlow】padding
- 【Linux】---文件描述符和文件指针
- mapreduce 的过程
- 【数论】洛谷 P1214 [USACO1.4]等差数列 Arithmetic Progressions
- 详讲钢琴卷轴之编辑菜单
- docker下使用disconf:极速体验