(lesson) Invalid argument in Action URL when form form is submitted

Source: Internet
Author: User

Submit a form today with the following information:

<form action= "add.php?a=123&b=456" >
<input type= "hidden" name= ' user_id ' value= "/>"
<input type= "hidden" name= ' user_name ' value= "Snsgou"/>
...
<input type= "Submit" Name= ' Sub ' value= "Commit"/>
</form>

Service side alive and alive gets not the value of parameter a and parameter B ,, through the fiddler tool Trace Analysis, found that the commit process went get way, I meant to POST submitted, A closer look, theform node less Set the method property , if not actively set, it is the default value of get, this will know the problem lies,,, pay attention to this place!!! Hope not to make the same mistake in the future!!!

Basic knowledge of Evil:

There are two forms when a page submits data to the server through a form (form), one is post and the other is get. One difference between the two is that get attaches the data directly behind the URL, and the data sent by the post is placed in the HTTP packet. The Action property of the form is the URL address of the data being submitted, and the method property can be specified as Get or post.

It is important to note that if a GET method is used, the parameters in the action URL are discarded , and the data in the form is only stitched to the server at the time of submission, but not in the same way as the POST . It submits the data according to the URL specified by the action, including the parameters and parameter values followed by the URL.

(lesson) Invalid argument in Action URL when form form is submitted

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.