PHP curl POST 获取返回整个页面值

网友投稿 329 2022-08-31

PHP curl POST 获取返回整个页面值

使用php的curl可以实现支持FTP、FTPS、HTTP HTPPS SCP SFTP TFTP TELNET DICT FILE和LDAP。curl 支持SSL证书、HTTP POST、HTTP PUT 、FTP 上传,kerberos、基于HTT格式的上传、代理、cookie、用户+口令证明、文件传送恢复、= curl_init("​​/​​​") ;curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) ;curl_setopt($ch, CURLOPT_BINARYTRANSFER, true) ;$output = curl_exec($ch) ;$fh = fopen("out.html", 'w') ;fwrite($fh, $output) ;fclose($fh) ;

2、data from the post extract($_POST) ; //set POST variables $url = '; $fields = array( 'bill_ID' => urlencode('201002420268'), 'hname' => urlencode('hvalue') ); //url-ify the data for the POST $fields_string =''; foreach($fields as $key=>$value) { $str = $key.'='.$value.'&'; $fields_string .= $str; } rtrim($fields_string ,'&') ; //open connection $ch = curl_init() ; //set the url, number of POST vars, POST data $url = $url.rtrim($fields_string ,'&') ; curl_setopt($ch, CURLOPT_URL,$url) ; curl_setopt($ch, CURLOPT_POST,count($fields)) ; curl_setopt($ch, CURLOPT_POSTFIELDS,$fields_string) ; //execute post $result = curl_exec($ch) ; print_r($result); //close connection curl_close($ch) ;

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:“劳模”黄东萍丹麦赛夺冠,张军为国羽队员煲鸡汤!
下一篇:Core Data浅谈系列之六 : 验证用户输入
相关文章

 发表评论

暂时没有评论,来抢沙发吧~