廣受客戶好評,滿足您的居家收納和風格,免費丈量設計 客製化系統家具,充分滿足居家空間機能需求 | 現場免費專人估價,廠房拆除、違章建築拆除 專業工程團隊,親切用心服務您! |
[php] 用CURL進行POST發送數據 |
房東:威威 發表時間:2012-07-17 |
1、POST代碼
2、發送文件代碼
原文地址:http://bbs.chinaunix.net/thread-748708-1-1.html ******************************************************************** 附:CURL普通操作代碼 1、http的get實現 $ch = curl_init("http://www.jb51.net/") ; 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實現 //extract data from the post extract($_POST) ; //set POST variables $url = 'http://www.jb51.net/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) ); //url-ify the data for the POST foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&' ; } rtrim($fields_string ,'&') ; //open connection $ch = curl_init() ; //set the url, number of POST vars, POST data 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) ; //close connection curl_close($ch) ; 原文地址:http://www.jb51.net/article/15554.htm http://merry05.blog.hexun.com.tw/69484190_d.html |
|
廣利不動產-板橋在地生根最實在--新板特區指名度最高、值得您信賴的好房仲 完整房訊,房屋、店面熱門精選物件,廣利不動產 優質仲介,房屋租賃、買賣資訊透明,交易真安心! 廣利不動產-新板特區指名度最高、值得您信賴的好房仲 您的托付,廣利用心為您服務 |
1 樓住戶:jack 發表時間:2012-07-17 |
//請求頁面 $address=array( 'hidden_d_name'=>$_POST['jackreewwwlwlwlw'], 'heidden_sld%5Bcom.tw%5D'=>$_POST['com.tw'], 'select_year%5Bcom.tw%5D'=>$_POST['D0903241601COMTW01'], 'text_passwd%5Bcom.tw%5D'=>$_POST['budweiser'], 'text_check_passwd0'=>$_POST['budweiser'], 'app_cname'=>$_POST['%B6%C0%ADP%B8R'], 'app_ename'=>$_POST['james+huang'], 'app_id'=>$_POST['A12103033'], 'app_cellphone'=>$_POST['0930420500'], 'app_tel_top'=>$_POST['02'], 'app_tel_center'=>$_POST['2956544'], 'app_tel_down'=>$_POST['2222'], 'app_fax_top'=>$_POST['3333'], 'app_fax_center'=>$_POST['3333'], 'app_email1'=>$_POST['[email protected]'], 'app_email2'=>$_POST['[email protected]'], 'text_zipcode'=>$_POST['100'], 'text_cmp_caddr'=>$_POST['%A5x%A5_%A5%AB%A4%A4%A5%BF%B0%CF%AAL%B4%CB%ABn%B8%F4142%B8% B911%BC%D3'], 'text_cmp_eaddr'=>$_POST['6F.%2C+No.47%2C+Wujhou+St.%2C+Wanhua+District% 2C+Taipei+Ci&whois=0'], 'scmp_cname'=>$_POST[' '], 'sapp_cname'=>$_POST[''], 'scmp_id'=>$_POST[''], 'sapp_email'=>$_POST[''], 'sapp_tel_top'=>$_POST[''], 'sapp_tel_center'=>$_POST[''], 'sapp_tel_down'=>$_POST[''], 'sapp_cellphone'=>$_POST[''], 'scmp_zipcode'=>$_POST[''], 'scmp_caddr'=>$_POST[''] ); $ch = curl_init("http://rs.apol.com.tw/add_product.php"); curl_setopt($ch,CURLOPT_POST,1); curl_setopt($ch,CURLOPT_POSTFIELDS,$address); $ret = curl_exec($ch); curl_close($ch); echo"$ret"; ?> |
2 樓住戶:jack 發表時間:2012-07-18 |
$ch = curl_init('http://rs.apol.com.tw/dns-4-1.php'); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, "d_name=jacksfss22&checkbox%5Bcom.tw%5D=com.tw"); $output = curl_exec($ch); curl_close($ch); ?> |
姓名: | |||
佈告內容: | |||
其他選項: | |||
|