專業防水抓漏服務,30多年經驗
品質保證,值得您信賴!
門窗工程免費估價!知名建案配合
外牆清潔絕不轉包,隨傳隨到!

首頁  •  j2h 論壇 • 程式設計討論     • 

[php] curl post

房東:呱呱
發表時間:2012-10-21


<?php

$urltopost = "http://127.0.0.1/j2hpost/yahoo/bbs/post.php";

$datatopost = array (

"j2h" => "Mike",

"j2h2" => "Lopez2222333",

"j2h5" => "[email protected]",

);




$ch = curl_init ($urltopost);

curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");

curl_setopt ($ch, CURLOPT_POST, true);

curl_setopt ($ch, CURLOPT_POSTFIELDS, $datatopost);

curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);

$returndata = curl_exec ($ch);


// Just for debug: to see response

echo $returndata;

?>





  • 贊助網站       

    廣利不動產-新板特區指名度最高、值得您信賴的好房仲
    您的托付,廣利用心為您服務
    廣利不動產-板橋在地生根最實在--新板特區指名度最高、值得您信賴的好房仲
    完整房訊,房屋、店面熱門精選物件,廣利不動產 優質仲介,房屋租賃、買賣資訊透明,交易真安心!

  • 1 樓住戶:呱呱
    發表時間:2012-10-21



    $ch = curl_init();
    $site = "http://127.0.0.1/j2hpost/yahoo/bbs/post.php";
    curl_setopt($ch,CURLOPT_REFERER,$site);
    curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1/j2hpost/yahoo/bbs/post.php');
    curl_setopt ($ch, CURLOPT_POST, 1);
    curl_setopt ($ch, CURLOPT_POSTFIELDS, 'j2h=testsss&j2h2=testssss&j2h5=sssssssss');
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    $store = curl_exec ($ch);
    echo $store;
    curl_close ($ch);

    ?>


    2 樓住戶:小白
    發表時間:2012-12-19

    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL,"http://localhost/posttest.php");
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, "Hello=World&Foo=Bar&Baz=Wombat");

    curl_exec ($curl);
    curl_close ($curl);
    ?>




     共 2 人回應  選擇頁數 【第1 頁】 

    姓名:
    佈告內容:
    其他選項: