469,290 Members | 1,887 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,290 developers. It's quick & easy.

What is the difference between REQUEST and REQUEST.QUERYSTRING?

What is the difference between these two statements? They seem to do the
same thing...

response.write(request("variable"))

response.write(request.querystring("variable"))


Jul 19 '05 #1
6 11523
Try this:

<form method="post" action="somepage.asp?x=6">
<input name="x" type="text" value="0">
<input type="submit">
</form>

On somepage.asp put:

response.write request("x")

What do you get? 6 or 9?
The request collection contains the querystring and form collections.
Always specify what you mean, either request.form or request.querystring.
Don't use just request by itself. It'll come back to bite you - especially
when you go to .net. :] Always qualify everything.

Ray at home
"michaaal" <re******@verizon.net> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
What is the difference between these two statements? They seem to do the
same thing...

response.write(request("variable"))

response.write(request.querystring("variable"))

Jul 19 '05 #2
Perfect answer, Ray. Extremely informative and also very practical. Thank
you!

"Ray at <%=sLocation%>" <ra*@ajf8jalskdfna.sefrhja7yasdf.com> wrote in
message news:OV**************@TK2MSFTNGP12.phx.gbl...
Try this:

<form method="post" action="somepage.asp?x=6">
<input name="x" type="text" value="0">
<input type="submit">
</form>

On somepage.asp put:

response.write request("x")

What do you get? 6 or 9?
The request collection contains the querystring and form collections.
Always specify what you mean, either request.form or request.querystring.
Don't use just request by itself. It'll come back to bite you - especially when you go to .net. :] Always qualify everything.

Ray at home
"michaaal" <re******@verizon.net> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
What is the difference between these two statements? They seem to do the same thing...

response.write(request("variable"))

response.write(request.querystring("variable"))


Jul 19 '05 #3
In addition to Ray's explanation: http://www.aspfaq.com/2111


"michaaal" <re******@verizon.net> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
What is the difference between these two statements? They seem to do the
same thing...

response.write(request("variable"))

response.write(request.querystring("variable"))

Jul 19 '05 #4
Ray at <%=sLocation%> wrote on 15 jul 2003 in
microsoft.public.inetserver.asp.general:
<form method="post" action="somepage.asp?x=6">
<input name="x" type="text" value="0">
<input type="submit">
</form>

On somepage.asp put:

response.write request("x")

What do you get? 6 or 9?


Real magic, I always seem to get 9 !

Where does this 9 come from? is it 6*1.5 ?

;--}

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #5
Ray at <%=sLocation%> wrote on 15 jul 2003 in
microsoft.public.inetserver.asp.general:
No, you see, if you don't specify, it takes the querystring value and
returns it inverted. So, if you had a querystring of L, you'd get 7 as a
result, and if your querystring is a W, you'd get an M, and so on.


That is why my regionalisation to Hieroglyphic LCID=96669 did invert
Horeb's eye "H" in the query stylus, while displaying the pictogram "N" for
water correctly.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #6
Aaron Bertrand - MVP wrote:
So be sure that names don't conflict.

Or, be sure to explicitly call the collection you are using. :-)


Yes, much better!8^)
Jul 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by diadia | last post: by
1 post views Thread by FD | last post: by
2 posts views Thread by rn5a | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.