The Curl function library implements the link of crawling Web content in http://www.cnblogs.com/linguanh/p/4292316.html
The following is a name and ID that is not identified by the
<input type= "Submit" value= "OnClick"/>
This type, after filling out the information, we generally need to click a button to trigger the commit event.
One of the variables that I described earlier in the article using curl to get a web cookie is to transfer past data,
This data is usually the website login account and password, corresponding to the input box name, below I give an example.
<input name= "UserName" id= "U" type= "text"/>
<input name= "PassWord" id= "P" type= "PassWord"/>
<input name= "Up" type= "Submit" value= "OnClick"/>
When we use a function to access its web page, the past data format may be
Username=123456&password=123&up=++%b5%c7%c2%bc++
How does this know?? First of all, we introduce you to a grab Bag tool, Firefox firebug, or other, is to grab the bag tool.
The above example is the simplest, in fact, if encountered I said <input type= "Submit" value= "OnClick"/>
This is the link to the action of its form because this is the real commit page, and then post username=123456&password=123 directly.
Ajax submissions, will be used to grab the package tool, crawl the source code, and then combined into data,post
Another situation is that there is a hidden input situation, what meaning, type= "hidden" This is not input, but we are using the Curl function to access the landing page
If you want to successfully go in, you need to send the input used, for the case of hidden, is also used to grab the package tool.
The final hint is, remember, the data transmission is urlencode encoded data, before the transmission, remember to encode, directly apply the Capture tool source code, no longer coded, it has helped you dry.
Questions that you might encounter when you post a Web page data with the Curl function and when the form submits a type of submit, with no Name and ID, and how to resolve it