国产女人18毛片水真多18精品, 一区二区三区中文字-亚洲精品女国产, 欧美熟妇老熟妇88888久久久久, 一级毛片免费观看亚洲欧美国产精品,大波霸美女视频,日韩欧美激情V影院,熟女人伦21p,亚洲精品女国产,国产 乱子伦 在线

php的curl實(shí)現(xiàn)get和post的代碼

時(shí)間:2025-11-12 15:37:07 php語(yǔ)言

php的curl實(shí)現(xiàn)get和post的代碼

  類似于dreamhost這類主機(jī)服務(wù)商,是顯示fopen的使用的。使用php的curl可以實(shí)現(xiàn)支持FTP、FTPS、HTTP HTPPS SCP SFTP TFTP TELNET DICT FILE和LDAP。具體使用如下,更多消息請(qǐng)關(guān)注應(yīng)屆畢業(yè)生網(wǎng)!
  curl 支持SSL證書、HTTP POST、HTTP PUT 、FTP 上傳,kerberos、基于HTT格式的上傳、代理、cookie、用戶+口令證明、文件傳送恢復(fù)、http代理通道就最常用的來(lái)說(shuō),是基于http的get和post方法。
  代碼實(shí)現(xiàn):
  1、http的get實(shí)現(xiàn)
  代碼如下:
  ?
  $ch = curl_init("/pic/") ;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、http的post實(shí)現(xiàn)
  代碼如下:
  ?
  /pic/div>
  extract($_POST) ;
  /pic/div>
  $url = '/pic/get-post.php' ;$fields = array('lname'=>urlencode($last_name) ,'fname'=>urlencode($first_name) ,
  'title'=>urlencode($title) ,
  'company'=>urlencode($institution) ,
  'age'=>urlencode($age) ,
  'email'=>urlencode($email) ,
  'phone'=>urlencode($phone)
  );
  /pic/div>
  foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&' ; }
  rtrim($fields_string ,'&') ;