What is the difference between REQUEST and REQUEST.QUERYSTRING?

Discussion in 'ASP General' started by michaaal, Jul 15, 2003.

  1. michaaal

    michaaal Guest

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

    response.write(request("variable"))

    response.write(request.querystring("variable"))
    michaaal, Jul 15, 2003
    #1
    1. Advertising

  2. michaaal

    Ray at Guest

    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" <> wrote in message
    news:...
    > What is the difference between these two statements? They seem to do the
    > same thing...
    >
    > response.write(request("variable"))
    >
    > response.write(request.querystring("variable"))
    >
    >
    >
    >
    Ray at, Jul 15, 2003
    #2
    1. Advertising

  3. michaaal

    michaaal Guest

    Perfect answer, Ray. Extremely informative and also very practical. Thank
    you!

    "Ray at <%=sLocation%>" <7yasdf.com> wrote in
    message news:...
    > 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" <> wrote in message
    > news:...
    > > What is the difference between these two statements? They seem to do

    the
    > > same thing...
    > >
    > > response.write(request("variable"))
    > >
    > > response.write(request.querystring("variable"))
    > >
    > >
    > >
    > >

    >
    >
    michaaal, Jul 15, 2003
    #3
  4. In addition to Ray's explanation: http://www.aspfaq.com/2111




    "michaaal" <> wrote in message
    news:...
    > What is the difference between these two statements? They seem to do the
    > same thing...
    >
    > response.write(request("variable"))
    >
    > response.write(request.querystring("variable"))
    >
    >
    >
    >
    Aaron Bertrand [MVP], Jul 15, 2003
    #4
  5. michaaal

    Evertjan. Guest

    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)
    Evertjan., Jul 15, 2003
    #5
  6. michaaal

    Evertjan. Guest

    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)
    Evertjan., Jul 15, 2003
    #6
  7. 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^)
    Michael D. Kersey, Jul 15, 2003
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Bass
    Replies:
    2
    Views:
    3,695
    dave wanta
    Jul 4, 2003
  2. George
    Replies:
    5
    Views:
    6,588
    George
    Apr 2, 2004
  3. jakk
    Replies:
    4
    Views:
    12,018
  4. Santa
    Replies:
    1
    Views:
    1,058
    Mark A. Odell
    Jul 17, 2003
  5. sripathi
    Replies:
    0
    Views:
    1,218
    sripathi
    Dec 31, 2009
Loading...

Share This Page