post data to form, failed.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fydwell
    New Member
    • Feb 2010
    • 3

    post data to form, failed.

    I am just a newbie for PHP. though I tried times to solve this, it is still showing "abnormal visit or too much frequent visit".

    the normal browser steps as:
    1. browse http://qyxy.baic.gov.cn/zhcx/zhcxAct...st.dhtml?op=cx .
    2. input 110000450124316 in one of the blanks, then click lookup.
    3. the browser will show additional link as lookup result below the same page.

    what I need is the result link as:


    I use httpwatch to get all the informations as:
    URL: http://qyxy.baic.gov.cn/zhcx/zhcxAct...st.dhtml?op=cx
    Code:
    [Header]
    (Request-Line)	POST /zhcx/zhcxAction!list.dhtml?op=cx HTTP/1.1
    Accept	image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*
    Accept-Encoding	gzip, deflate
    Accept-Language	en-us,zh-cn;q=0.5
    Cache-Control	no-cache
    Connection	Keep-Alive
    Content-Length	129
    Content-Type	application/x-www-form-urlencoded
    Cookie	wdcid=34aa9fb9ffe6255b; wdlast=1266721025; JSESSIONID=8yGhLQgdY2sj9tpYcV3v71GhhSFdc7wFZnJLKMcypC0KXPlmr8Qz!804296455; BIGipServerPool_xy=202746048.23323.0000
    Host	qyxy.baic.gov.cn
    Referer	http://qyxy.baic.gov.cn/zhcx/zhcxAction!list.dhtml?op=cx
    User-Agent	Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
    [Cookies]
    BIGipServerPool_xy	Sent	219523264.16671.0000	                                            /	qyxy.baic.gov.cn	(Session)
    JSESSIONID	        Sent	NhTkLJsKXg0Ct78Bw1PpS93w5HpzZ71bYnThphv7LNLQt514yXxL!-2027153694    /	qyxy.baic.gov.cn	(Session)
    wdcid	                Sent	34aa9fb9ffe6255b	                      /	qyxy.baic.gov.cn	Fri, 01-Jan-2038 00:00:00 GMT
    wdlast	                Sent	1267330135	                              /	qyxy.baic.gov.cn	Fri, 01-Jan-2038 00:00:00 GMT
    [Query String]
    op	cx
    [Post Data]
    zhcxModel.cer_no	
    zhcxModel.cer_type	
    zhcxModel.corp_rpt	
    zhcxModel.dom	
    zhcxModel.ent_name	
    zhcxModel.lic_reg_no	110000450124316
    so could anybody help me out? I tries several days, still shows nothing or "abnormal visit or too much frequent visit".
    Last edited by Atli; Feb 28 '10, 09:01 AM. Reason: Added a bit of formatting, to make it easier to read.
  • fydwell
    New Member
    • Feb 2010
    • 3

    #2
    below is my code

    Code:
    <?
    $url = "http://qyxy.baic.gov.cn/zhcx/zhcxAction!list.dhtml?op=cx";
    
    $http_header = array(
        "Accept" => "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*",
        "Accept-Encoding" => "gzip, deflate",
        "Accept-Language" => "en-us,zh-cn;q=0.5",
        "Connection" => "Keep-Alive",
        "Content-Type" => "application/x-www-form-urlencoded",
        "Host" => "qyxy.baic.gov.cn",
        "Referer" => "http://qyxy.baic.gov.cn/zhcx/zhcxAction!list.dhtml?op=cx",
        "User-Agent" => "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
    );
    
    $post_data = array (
        "zhcxModel.ent_name" => "",
        "zhcxModel.lic_reg_no" => "110000450124316",
        "zhcxModel.corp_rpt" => "",
        "zhcxModel.cer_type" => "",
        "zhcxModel.cer_no" => "",
        "zhcxModel.dom" => ""
    );
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
                    "Accept: {$http_header['Accept']}",
                    "Accept-Encoding: {$http_header['Accept-Encoding']}",
                    "Accept-Language: {$http_header['Accept-Language']}",
                    "Connection: {$http_header['Connection']}",
                    "Content-Type: {$http_header['Content-Type']}",
                    "Host: {$http_header['Host']}",
                    "Referer: {$http_header['Referer']}",
                    "User-Agent: {$http_header['User-Agent']}"
                ));
     
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); 
    curl_setopt ($ch, CURLOPT_MAXREDIRS, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt ($ch, CURLOPT_COOKIE , "wdcid=34aa9fb9ffe6255b; wdlast=1267275231; JSESSIONID=vR2bLJVL6vX1szYP28WJ4v3Vp259hklhhZMQ11TjVfQPHLR1q2JB!-1846855717; BIGipServerPool_xy=219523264.17183.0000" );
    curl_setopt($ch, CURLOPT_TIMEOUT, 30);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,0);
    
    $output = curl_exec($ch);
    curl_close($ch);
    echo $output;
    
    ?>

    Comment

    • fydwell
      New Member
      • Feb 2010
      • 3

      #3
      attached are pictures before and after lookup.
      Attached Files

      Comment

      Working...