Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieving parameters from request ASP Classic 3.0

Is there a problem or difference between retrieving the request parameter as follows:

Request("<ParamName>")

Instead of:

Request.Form("<ParamName>") or
Request.QueryString("<ParamName>") ?

Thanks in advance!

like image 717
EProgrammerNotFound Avatar asked May 15 '26 12:05

EProgrammerNotFound


1 Answers

Request.Form() will get values that are POSTed. Request.QueryString() will contain values from the query string. Request() will contain the POSTed value, unless there is a QueryString value for the same name, in which case it will contain the QueryString value.

I think cookies can be involved too, but my memory is a bit foggy on how they fit into the stack.

If you care about the value coming from a POSTed form, then use Request.Form(), if you care about a URL querystring value then use Request.QueryString(). If you don't care, just use Request().

Quick sample to test:

<% OPTION EXPLICIT %>
<%
    dim vname : vname = "test"

    dim r   : r   = request(vname)
    dim r_f : r_f = request.form(vname)
    dim r_q : r_q = request.querystring(vname)

%>
POST:<br />
<form method="post">
<input type="text" name="test" value="Posted Form Value">
<input type="submit" name = "">
</form>

<hr>

<a href='?test=<% = Server.HtmlEncode("Querystring in URL") %>'>GET</a>

<hr>
request: <% = r %>

<hr>
request.form: <% = r_f %>

<hr>
request.querystring: <% = r_q %>
like image 53
My Other Me Avatar answered May 19 '26 03:05

My Other Me



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!