473,396 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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:
http://qyxy.baic.gov.cn/kscx/kscxAct...78d&flag_cer=0

I use httpwatch to get all the informations as:
URL: http://qyxy.baic.gov.cn/zhcx/zhcxAct...st.dhtml?op=cx
Expand|Select|Wrap|Line Numbers
  1. [Header]
  2. (Request-Line)    POST /zhcx/zhcxAction!list.dhtml?op=cx HTTP/1.1
  3. Accept    image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*
  4. Accept-Encoding    gzip, deflate
  5. Accept-Language    en-us,zh-cn;q=0.5
  6. Cache-Control    no-cache
  7. Connection    Keep-Alive
  8. Content-Length    129
  9. Content-Type    application/x-www-form-urlencoded
  10. Cookie    wdcid=34aa9fb9ffe6255b; wdlast=1266721025; JSESSIONID=8yGhLQgdY2sj9tpYcV3v71GhhSFdc7wFZnJLKMcypC0KXPlmr8Qz!804296455; BIGipServerPool_xy=202746048.23323.0000
  11. Host    qyxy.baic.gov.cn
  12. Referer    http://qyxy.baic.gov.cn/zhcx/zhcxAction!list.dhtml?op=cx
  13. User-Agent    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
  14. [Cookies]
  15. BIGipServerPool_xy    Sent    219523264.16671.0000                                                /    qyxy.baic.gov.cn    (Session)
  16. JSESSIONID            Sent    NhTkLJsKXg0Ct78Bw1PpS93w5HpzZ71bYnThphv7LNLQt514yXxL!-2027153694    /    qyxy.baic.gov.cn    (Session)
  17. wdcid                    Sent    34aa9fb9ffe6255b                          /    qyxy.baic.gov.cn    Fri, 01-Jan-2038 00:00:00 GMT
  18. wdlast                    Sent    1267330135                                  /    qyxy.baic.gov.cn    Fri, 01-Jan-2038 00:00:00 GMT
  19. [Query String]
  20. op    cx
  21. [Post Data]
  22. zhcxModel.cer_no    
  23. zhcxModel.cer_type    
  24. zhcxModel.corp_rpt    
  25. zhcxModel.dom    
  26. zhcxModel.ent_name    
  27. 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".
Feb 28 '10 #1
2 2684
below is my code

Expand|Select|Wrap|Line Numbers
  1. <?
  2. $url = "http://qyxy.baic.gov.cn/zhcx/zhcxAction!list.dhtml?op=cx";
  3.  
  4. $http_header = array(
  5.     "Accept" => "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*",
  6.     "Accept-Encoding" => "gzip, deflate",
  7.     "Accept-Language" => "en-us,zh-cn;q=0.5",
  8.     "Connection" => "Keep-Alive",
  9.     "Content-Type" => "application/x-www-form-urlencoded",
  10.     "Host" => "qyxy.baic.gov.cn",
  11.     "Referer" => "http://qyxy.baic.gov.cn/zhcx/zhcxAction!list.dhtml?op=cx",
  12.     "User-Agent" => "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
  13. );
  14.  
  15. $post_data = array (
  16.     "zhcxModel.ent_name" => "",
  17.     "zhcxModel.lic_reg_no" => "110000450124316",
  18.     "zhcxModel.corp_rpt" => "",
  19.     "zhcxModel.cer_type" => "",
  20.     "zhcxModel.cer_no" => "",
  21.     "zhcxModel.dom" => ""
  22. );
  23.  
  24. $ch = curl_init();
  25. curl_setopt($ch, CURLOPT_URL, $url);
  26. curl_setopt($ch, CURLOPT_HTTPHEADER, array(
  27.                 "Accept: {$http_header['Accept']}",
  28.                 "Accept-Encoding: {$http_header['Accept-Encoding']}",
  29.                 "Accept-Language: {$http_header['Accept-Language']}",
  30.                 "Connection: {$http_header['Connection']}",
  31.                 "Content-Type: {$http_header['Content-Type']}",
  32.                 "Host: {$http_header['Host']}",
  33.                 "Referer: {$http_header['Referer']}",
  34.                 "User-Agent: {$http_header['User-Agent']}"
  35.             ));
  36.  
  37. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); 
  38. curl_setopt ($ch, CURLOPT_MAXREDIRS, 1);
  39. curl_setopt($ch, CURLOPT_POST, 1);
  40. curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
  41. curl_setopt ($ch, CURLOPT_COOKIE , "wdcid=34aa9fb9ffe6255b; wdlast=1267275231; JSESSIONID=vR2bLJVL6vX1szYP28WJ4v3Vp259hklhhZMQ11TjVfQPHLR1q2JB!-1846855717; BIGipServerPool_xy=219523264.17183.0000" );
  42. curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  43. curl_setopt($ch, CURLOPT_RETURNTRANSFER,0);
  44.  
  45. $output = curl_exec($ch);
  46. curl_close($ch);
  47. echo $output;
  48.  
  49. ?>
Feb 28 '10 #2
attached are pictures before and after lookup.
Attached Files
File Type: zip html.pictures.zip (167.0 KB, 118 views)
Feb 28 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Matt | last post by:
The following program submit a FORM DATA to a new window using HTTP POST, and postprocess.asp couldn't get the form data. If I do in GET method and pass by query string in windowURL, then it...
7
by: Julia | last post by:
Hi, I have a web application running inside an organization and I need to post some data to an asp page sitting outside the organization How do I get failure or success error from the outside...
2
by: Fatih BOY | last post by:
Hi, I want to send a report from a windows application to a web page like 'report.asp' Currently i can send it via post method with a context like local=En&Username=fatih&UserId=45&Firm=none...
6
by: someone | last post by:
I am in a situation where I need to package some information from Page1, submit it via POST to another server which will process the information and then send the user to another page on my server...
4
by: Wayne P. | last post by:
I'm working on a shopping cart webapp and I need to perform a form POST of data to a 3rd party site (a payment processor, StormPay). I seem to be having problems doing this. I have an image...
1
by: google | last post by:
I'm building a small ASPX page in C# to forward HTTP POST requests to another site. When the other site returns an HTTP error such as 404 or 405, I want to return that same HTTP status value to my...
12
by: Michael Lang | last post by:
I'm adding checkbox controls to a panel in a post back, I then have a second post back in which I attempt to process the checkbox controls however they seem to have disappeared off the panel. The...
0
by: barrybevel | last post by:
Hi, I'm trying to login to the www.vodafone.ie website using HttpWebRequest. It works fine with IE/Firefox and the .NET Web Control too, just not with my code. I think it's a redirect 302...
8
by: BiT | last post by:
Hello, I'm working right now on project in vb.net 2005 for my company, i need the project to download file from the company web site. In order to get the file i have to give the site address...
5
by: =?Utf-8?B?QWxleCBNYWdoZW4=?= | last post by:
I am trying to create ASPX code which will allow me to redirect a user to another site with POST data. I figure that the best way to do this is with JavaScript to the client. Here's what I'm doing:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.