没明白LZ意思  不知道用$_POST['']可不可以~~

解决方案 »

  1.   

    如果用 post的表单,应该有一个提交动作,或者用一个事件触发js。
    如 function TJsub() {
    document.form1.action ="test.php?action=setup
    settings.submit();
    }
      

  2.   

    不好意思,上面的js应该是:
    function TJsub() {
    document.form1.action ="test.php?action=setup
    from1.submit();
    }
      

  3.   

    我的最终目的是要调用别人的查询页面把结果插到我的网页里.
    -----------------------Why not get the contents of the result page directly???
      

  4.   

    自己构造一个HTTP请求,然后将数据POST过去应该没有问题,下面是测试代码。基本原理就是这个了。
    详细的HTTP协议可以读一下 RFC 2616。下面的代码执行以后能在返回的字符中发现“<tr><td colspan=2 align=center style="color: red ;">验证码不匹配,请重新输入验证码</td></tr>”,说明数据已经被正常的POST到baidu去了function read_http_post($host, $file, $uid, $pwd)
    {
    if (!$fp=fsockopen($host,80, $errno, $errstr, 15))
    return false;
       
    $post = "tpl=&tpl_ok=&skip_ok=&aid=0&need_pay=&need_coin=0&pay_method=0&u=&next_target=&return_method=&more_param=&return_type=&username=$uid&password=$pwd&verifycode=0338&Submit=+%B5%C7%C2%BC+"; $out = "POST /$file HTTP/1.1\r\n";
    $out .= "Host: $host\r\n";
    $len = strlen($post);
    $out .= "Content-Type: application/x-www-form-urlencoded\r\n";
    $out .= "Referer: http://passport.baidu.com/?login\r\n";
    $out .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon;)\r\n";
    $out .= "Content-Length: $len\r\n";
    $out .= "Connection: Keep-Alive\r\n";
    $out .= "Cookie: BAIDUID=F6255B5C19AB4E25E923A4B00DFD7F16; BDUSS=JUTFdxOVJvM25BbHRXYXpxZ0lmVHBIMVdPa2ZRYWl-emliTDNMNlJGYkFNdTFFQUFBQUFBJCQAAAAAAAAAAAAAAACAHPwAbGFuc3oyMDUwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMClxUTApcVENU; PASSPORTRETRYSTRING=1153803768%7C1153804122%7C1153804129\r\n\r\n";
    $out .= $post; fwrite($fp, $out); $line = "";
    while (!feof($fp))
    {
    $line .= fgets($fp, 2048);
       if(preg_match("/<\/HTML>/", $line))
       break;
    } fclose($fp);
       
    return $line;
    }echo read_http_post("passport.baidu.com", "?login", "baidu", "baidu");