× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Mixing GET and POST Methods
  • From: Mel Rothman <mel@xxxxxxxxxxxxxx>
  • Date: Mon, 30 Jul 2001 23:47:41 -0500

To clarify, data passed with the URI/URL in the form
...?var1=val1&var2=val2... is always sent via the QUERY_STRING
environment variable.  

Data sent from a <form> with method="GET" also is sent via the
QUERY_STRING environment variable.  

Data sent from a <form> with method="POST" is sent via standard input.  

You cannot, at least with our HTTP Server, "mix URI and query string
data" since they both would use the QUERY_STRING environment variable. I
have tested this and only the <form> data is received.  I know you can
mix URI data and POSTed data.

Mel Rothman
CGIDEV2 Author ( get it at http://www.easy400.ibm.it/ )
iSeries Custom Technology Center
Rochester, Minnesota


"Goodbar, Loyd (AFS-Water Valley)" wrote:
> 
> Bad choice of words on my part. I should have said "determined" instead of
> "picks one". I used the same type code in CGI programs before converting to
> CGIDEV2.
> 
> I didn't know it was even possible to mix URI and query string data. Some
> languages (PHP comes to mind), can specify an order in which to assign
> values to a variable depending on the order of GET, POST, or cookie data.
> 
> Loyd
> 
> -----Original Message-----
> From: Mel Rothman [mailto:mel@rothmanweb.com]
> Sent: Friday, July 27, 2001 11:06 PM
> To: WEB400@midrange.com
> Subject: Re: Mixing GET and POST Methods
> 
> Loyd, you are absolutely right about "You may either use GET *or* POST on a
> single request."
> 
> However, CGIDEV2 does not "pick" which method to use.  For each request, it
> determines whether the request method is GET or POST (by reading the
> REQUEST_METHOD environment variable) and performs the appropriate processing
> (read CONTENT_LENGTH bytes from standard input if POST; retrieve
> QUERY_STRING
> environment variable if GET).  Then it makes the input data available to the
> program.
> 
> It can't be known until run time which method a particular request uses.
> For
> example, the same CGI program can be called in several ways:
> 
> 1. Via a form with request method POST (or GET)
> 2. Via a link in another page, with or without data, in which case the
> browser
> sends the request as a GET.
> 3. By the user entering a URL into the browser, again, with or without data.
> 
> You can try this yourself with virtually any CGI program written with
> CGIDEV2.
> 
> It is possible to have data in standard input AND in the QUERY_STRING
> environment variable.  I think Chris was referring to this.
> 
> For example:
> 
> <form method="post" action="/cgi-bin/programa.pgm?data=hello">
> <input type="hidden" name"hide01" value="guess who?"
> Other <input> tags
> </form>
> 
> Standard input contains: hide01=guess+who...data from other tags...
> QUERY_STRING contains: data=hello
> 
> CGIDEV2's ZhbGetInput subprocedure handles this.  Unfortunately, there
> appears
> to be a bug in the HTTP server that causes QtmhGetEnv to return QUERY_STRING
> as
> data=.  I posted a workaround for this bug a few hours ago.
> 
> I hope this clarifies the issue for anyone interested in it.
> 
> Mel Rothman
> CGIDEV2 Author
> IBM Rochester
> +---
> | This is the WEB400 Mailing List!
> | To submit a new message, send your mail to WEB400@midrange.com.
> | To subscribe to this list send email to WEB400-SUB@midrange.com.
> | To unsubscribe from this list send email to WEB400-UNSUB@midrange.com.
> | Questions should be directed to the list owner/operator: david@midrange.com
> +---
+---
| This is the WEB400 Mailing List!
| To submit a new message, send your mail to WEB400@midrange.com.
| To subscribe to this list send email to WEB400-SUB@midrange.com.
| To unsubscribe from this list send email to WEB400-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.