Curl版本POST提交

发布于:2013年12月17日已被阅读
/** 
* Curl版本 
* 使用方法: 
* $post_string = "app=request&version=beta"; 
* request_by_curl('http://www.80wow.com/api.php',$post_string); 
*/ 
function request_by_curl($remote_server,$post_string){ 
$ch = curl_init(); 
curl_setopt($ch,CURLOPT_URL,$remote_server); 
curl_setopt($ch,CURLOPT_POSTFIELDS,'mypost='.$post_string); 
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); 
curl_setopt($ch,CURLOPT_USERAGENT,"Jimmy's CURL Example beta"); 
$data = curl_exec($ch); 
curl_close($ch); 
return $data; 
}


上一篇文章: jQuery UI 教程之二 ——jquery ui dialog的使用

下一篇文章: concat和concat_ws()区别及MySQL的几个实用字符串函数
热门博文
默认方法2(10114)
听过PHP吗(3497)
javascript是最棒的(1078)
Curl版本POST提交(191)
MySQL小技巧:让你忘记MySQL密码(180)
最新发布
css默认样式(134)
linux samba配置(144)
mysql经典语句(142)
js 中日期 转换成时间戳 例如2013(155)
MySQL字段拼接查询(152)
友情连接
80年代
百度
京ICP备14027197号-1 网站版权归80年代博客所有
正在加载中……