php curl模拟post请求提交数据例子总结_PHP教程
注意:curl函数在php中默认是不被支持的,如果需要使用curl函数我们需在改一改你的php.ini文件的设置,找到php_curl.dll去掉前面的";"就行了
例1
代码如下 | 复制代码 |
$uri = "http://tanteng.duapp.com/test.php"; 接受php页面远程服务器: if(isset($_POST['name'])){ |
例2
用CURL模拟POST请求抓取邮编与地址
完整代码:
代码如下 | 复制代码 |
#!/usr/local/php/bin/php
| |
[sS]*? | [s]*?
模拟POST请求 提交数据或上传文件 .
.
代码如下 | 复制代码 |
http://www.a.com/a.php 发送POST请求 function execUpload(){
} 2.http://www.b.com/handleUpload.php function handleUpload(){ |
■cURL 函数
■curl_close — 关闭一个cURL会话
■curl_copy_handle — 复制一个cURL句柄和它的所有选项
■curl_errno — 返回最后一次的错误号
■curl_error — 返回一个保护当前会话最近一次错误的字符串
■curl_exec — 执行一个cURL会话
■curl_getinfo — 获取一个cURL连接资源句柄的信息
■curl_init — 初始化一个cURL会话
■curl_multi_add_handle — 向curl批处理会话中添加单独的curl句柄
■curl_multi_close — 关闭一组cURL句柄
■curl_multi_exec — 运行当前 cURL 句柄的子连接
■curl_multi_getcontent — 如果设置了CURLOPT_RETURNTRANSFER,则返回获取的输出的文本流
■curl_multi_info_read — 获取当前解析的cURL的相关传输信息
■curl_multi_init — 返回一个新cURL批处理句柄
■curl_multi_remove_handle — 移除curl批处理句柄资源中的某个句柄资源
■curl_multi_select — 等待所有cURL批处理中的活动连接
■curl_setopt_array — 为cURL传输会话批量设置选项
■curl_setopt — 设置一个cURL传输选项
■curl_version — 获取cURL版本信息
下一篇: 使用node.js构建命令行工具
推荐阅读
-
PHP基于curl模拟post提交json数据示例
-
php curl模拟post请求和提交多维数组的示例代码
-
php curl模拟post请求提交数据
-
php curl模拟post请求提交数据例子总结
-
php模拟post提交数据的方法,php模拟post提交_PHP教程
-
PHP模拟post提交数据方法汇总,phppost提交汇总_PHP教程
-
curl-php post提交数据,获取到的结果提示请求未找到!
-
求帮忙修改个php curl模拟post请求内容后并下载文件的解决思路,_PHP教程
-
php curl模拟post请求小实例_PHP教程
-
php curl模拟post提交数据示例_PHP教程