Home  >  Article  >  Web Front-end  >  Detailed explanation of the four forms of parameter passing_Basic knowledge

Detailed explanation of the four forms of parameter passing_Basic knowledge

WBOY
WBOYOriginal
2016-05-16 15:49:401375browse

This article is summarized in daily work. The four forms of parameter transfer are shown below.

When to use GET, search, delete,

When to use POST, add, change (Special: use POST to log in, because the username and password cannot be displayed on the URL)

4 ways to get parameters

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 
 <title></title> 
 <script type="text/javascript"> 
  function Go() { 
   window.location.href="localhost:21811/Handler1.ashx&#63;id=1&name='abc'" 
  } 
 </script> 
</head> 
<body> 


f0e6b910d325453764a4833a972f53be

fd095329e0eeee109ebe401c2a0f230e

Copy code The code is as follows:

localhost:21811/Handler1.ashx?id=1&name="abc"

7f8c2d2a920d5184ad81bd06c59b16a5

5f7fe65aae925ba0f20bcdd22ebe0965Hyperlink transfer parameters5db79b134e9f6b82c0b36e0489ee08ed36cc49f0c466276486e50c850b7e4956
684c5aa1a905bcf2d45cbf1cacd7da15
d764e2dfc3283d4fecccb664554ee603
c527c8576884e45cfcb290f0a2a835a0
 

 <form action="Handler1.ashx" method="get"><!--注意action里面的连接不能带参数的-->> 
  <input type="text" name="id" value="3" /> 
  <input type="text" name="name" value="abc" /> 
  <input type="submit" value="通过传递参数" /> 
 </form> 
</body> 
</html> 

Through the introduction of the above code, I believe everyone will like it.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn