Loading ...
Sorry, an error occurred while loading the content.

Re: Annoying problem POST works, GET does not, please help

Expand Messages
  • Tim Pushor
    Straight from http://www.apache-asp.org/objects.html#%24Request-%3EFo76659178: $Request- Form($name) Returns the value of the input of name $name used in a
    Message 1 of 4 , Feb 12, 2004
    • 0 Attachment
      Straight from
      http://www.apache-asp.org/objects.html#%24Request-%3EFo76659178:

      $Request->Form($name)

      Returns the value of the input of name $name used in a form with POST
      method.

      ... Later on ...

      $Request->QueryString($name)

      Returns the value of the input of name $name used in a form with GET
      method, or passed by appending a query string to the end of a url ..

      Check $Request->Params on the same page for a way to do what you want (I
      think) although thats not valid ASP..

      Tim


      Youngblood, Gregory (SAIC) wrote:

      >Good afternoon, I'm hoping someone can help me with what has to be a simple
      >problem. This is almost definitely a case of USER ERROR on my part, but it
      >is giving me fits.
      >
      >I want to call a URL, such as
      >http://127.0.0.1/index.asp?field1=value1&field2=value2, and get the data
      >from the URL.
      >The url is the same as one generated by a form using the GET method to
      >submit data.
      >
      >I would like to use $Request->Form('field1') to get value1 from field1. It
      >does not appear to work.
      >
      >I did verify that QUERY_STRING does have the field1=value1&field2=value2
      >data in it.
      >
      >I can also create a form using GET method and submit the data and still not
      >see the data in Request->Form.
      >
      >If I change the form to use the POST method, everything works. The only
      >problem is I want to use GET and not POST. I need to create text (and/or
      >image) links to the URL changing the value of field1 and field2 accordingly.
      >
      >I have a minimal config, httpd.doc has:
      >
      ><Files ~ (\.asp)>
      > SetHandler perl-script
      > PerlModule Apache::ASP
      > PerlHandler Apache::ASP
      > PerlSetVar Global /srv/www/lib
      > PerlSetVar StateDir /tmp/asp
      ></Files>
      >
      >and global.asa is empty. There is no .htaccess file. The file I'm calling is
      >"index.asp".
      >
      >index.asp is very short (for testing purposes):
      >
      ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      ><html>
      > <head>
      > <title>Test</title>
      > </head>
      > <body>
      > <h1>test 1</h1>
      > <form method=GET>
      > <input type=text name=field1 /><br />
      > <input type=text name=field2 /><br />
      > <input type=submit />
      > </form>
      > <h1>results 1:</h1>
      > <h2><%=$Request->Form('field1')%></h2>
      > <h2><%=$Request->Form('field2')%></h2>
      > <h1>test 2</h1>
      > <form method=POST>
      > <input type=text name=field1 /><br />
      > <input type=text name=field2 /><br />
      > <input type=submit />
      > </form>
      > <h1>results 2:</h1>
      > <h2><%=$Request->Form('field1')%></h2>
      > <h2><%=$Request->Form('field2')%></h2>
      > </body>
      ></html>
      >
      >This is on a SUSE9 Linux system.
      >
      >I can very easily write somethign to read QUERY_STRING, but one of the
      >advantages of Apache::ASP is the form handling. I thought the Request object
      >included processing for data submitted with GET and put the values in Form.
      >
      >Any clues or ideas?
      >
      >Thanks,
      >Greg
      >
      >---------------------------------------------------------------------
      >To unsubscribe, e-mail: asp-unsubscribe@...
      >For additional commands, e-mail: asp-help@...
      >
      >
      >

      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • Tim Pushor
      I didn t mean valid - of course its valid as far as apache-asp goes, but its an API Extention .. ... To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
      Message 2 of 4 , Feb 12, 2004
      • 0 Attachment
        I didn't mean 'valid' - of course its valid as far as apache-asp goes,
        but its an API Extention ..



        Tim Pushor wrote:

        > Straight from
        > http://www.apache-asp.org/objects.html#%24Request-%3EFo76659178:
        >
        > $Request->Form($name)
        >
        > Returns the value of the input of name $name used in a form with POST
        > method.
        >
        > ... Later on ...
        >
        > $Request->QueryString($name)
        >
        > Returns the value of the input of name $name used in a form with GET
        > method, or passed by appending a query string to the end of a url ..
        >
        > Check $Request->Params on the same page for a way to do what you want
        > (I think) although thats not valid ASP..
        >
        > Tim
        >
        >
        > Youngblood, Gregory (SAIC) wrote:
        >
        >> Good afternoon, I'm hoping someone can help me with what has to be a
        >> simple
        >> problem. This is almost definitely a case of USER ERROR on my part,
        >> but it
        >> is giving me fits.
        >> I want to call a URL, such as
        >> http://127.0.0.1/index.asp?field1=value1&field2=value2, and get the data
        >> from the URL.
        >> The url is the same as one generated by a form using the GET method to
        >> submit data.
        >>
        >> I would like to use $Request->Form('field1') to get value1 from
        >> field1. It
        >> does not appear to work.
        >>
        >> I did verify that QUERY_STRING does have the field1=value1&field2=value2
        >> data in it.
        >>
        >> I can also create a form using GET method and submit the data and
        >> still not
        >> see the data in Request->Form.
        >>
        >> If I change the form to use the POST method, everything works. The only
        >> problem is I want to use GET and not POST. I need to create text (and/or
        >> image) links to the URL changing the value of field1 and field2
        >> accordingly.
        >>
        >> I have a minimal config, httpd.doc has:
        >>
        >> <Files ~ (\.asp)>
        >> SetHandler perl-script
        >> PerlModule Apache::ASP
        >> PerlHandler Apache::ASP
        >> PerlSetVar Global /srv/www/lib
        >> PerlSetVar StateDir /tmp/asp
        >> </Files>
        >>
        >> and global.asa is empty. There is no .htaccess file. The file I'm
        >> calling is
        >> "index.asp".
        >>
        >> index.asp is very short (for testing purposes):
        >>
        >> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
        >> <html>
        >> <head>
        >> <title>Test</title>
        >> </head>
        >> <body>
        >> <h1>test 1</h1>
        >> <form method=GET>
        >> <input type=text name=field1 /><br />
        >> <input type=text name=field2 /><br />
        >> <input type=submit />
        >> </form>
        >> <h1>results 1:</h1>
        >> <h2><%=$Request->Form('field1')%></h2>
        >> <h2><%=$Request->Form('field2')%></h2>
        >> <h1>test 2</h1>
        >> <form method=POST>
        >> <input type=text name=field1 /><br />
        >> <input type=text name=field2 /><br />
        >> <input type=submit />
        >> </form>
        >> <h1>results 2:</h1>
        >> <h2><%=$Request->Form('field1')%></h2>
        >> <h2><%=$Request->Form('field2')%></h2>
        >> </body>
        >> </html>
        >>
        >> This is on a SUSE9 Linux system.
        >>
        >> I can very easily write somethign to read QUERY_STRING, but one of the
        >> advantages of Apache::ASP is the form handling. I thought the Request
        >> object
        >> included processing for data submitted with GET and put the values in
        >> Form.
        >> Any clues or ideas?
        >>
        >> Thanks,
        >> Greg
        >>
        >> ---------------------------------------------------------------------
        >> To unsubscribe, e-mail: asp-unsubscribe@...
        >> For additional commands, e-mail: asp-help@...
        >>
        >>
        >>
        >
        > ---------------------------------------------------------------------
        > To unsubscribe, e-mail: asp-unsubscribe@...
        > For additional commands, e-mail: asp-help@...
        >

        ---------------------------------------------------------------------
        To unsubscribe, e-mail: asp-unsubscribe@...
        For additional commands, e-mail: asp-help@...
      • Youngblood, Gregory (SAIC)
        Thanks - I KNEW it was user error on my part. And something simple. :) I must have read that page several times and skipped over QueryString (and Params) every
        Message 3 of 4 , Feb 12, 2004
        • 0 Attachment
          Thanks - I KNEW it was user error on my part. And something simple. :)

          I must have read that page several times and skipped over QueryString (and
          Params) every time. Not to mention missing the comment about "POST" in Form.


          Thanks again,
          Greg

          -----Original Message-----
          From: Tim Pushor [mailto:timp@...]
          Sent: Thursday, February 12, 2004 4:47 PM
          To: Youngblood, Gregory (SAIC)
          Cc: asp@...
          Subject: Re: Annoying problem POST works, GET does not, please help


          Straight from
          http://www.apache-asp.org/objects.html#%24Request-%3EFo76659178:

          $Request->Form($name)

          Returns the value of the input of name $name used in a form with POST
          method.

          ... Later on ...

          $Request->QueryString($name)

          Returns the value of the input of name $name used in a form with GET
          method, or passed by appending a query string to the end of a url ..

          Check $Request->Params on the same page for a way to do what you want (I
          think) although thats not valid ASP..

          Tim

          ---------------------------------------------------------------------
          To unsubscribe, e-mail: asp-unsubscribe@...
          For additional commands, e-mail: asp-help@...
        Your message has been successfully submitted and would be delivered to recipients shortly.