Request("controlname") can use for both GET and POST protocol??

M

Matt

If we use GET protocol, we can use either Request("controlname") or
Request.QueryString("controlname") to get the data entered by the user. But
if we use POST protocol, we MUST use Request("controlname"), and
Request.QueryString("controlname") won't work. I think
Request("controlname") means Request.Form("controlname"), which is used for
POST protocol. But seems like it works for GET protocol too.

Here's the code I tested.

<%
If (Request("submitgetbtn") = "GET Submit") Then
Response.Write(Request("fname"))
End If

If (Request.QueryString("submitpostbtn") = "POST Submit") Then
Response.Write(Request("lname"))
End If

%>
<form action="getposttest.asp" method="get">
<input type="text" name="fname">
<input type="submit" name="submitgetbtn" value="GET Submit">
</form>

<form action="getposttest.asp" method="post">
<input type="text" name="lname">
<input type="submit" name="submitpostbtn" value="POST Submit">
</form>

Please advise! Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top