[KLUG Members] apache / QUERY_STRING

Wesley Leonard members@kalamazoolinux.org
Thu, 31 Jan 2002 15:27:19 -0500


Thanks to Chris and Mike for responding.  You really got me thinking and I fixed
the problem!

I was using some code I got from a credit card processing site (I'm setting up
an ecommerce site) and I couldn't figure out why my POST forms weren't
working...

well, they were looking at CONTENT_TYPE instead of CONTENT_LENGTH and doing
something like this:

read( 0, buf, atoi( content_type ) );

I changed it to the content length variable and it works!

Thanks again.

Mike Slack wrote:
> 
> It's been a while for me since I've looked into the details of this, so take whatever I say with a grain of salt.
> 
> My question is, if you are using POST, why do you need QUERY_STRING?  If I remember correctly, QUERY_STRING is everything that comes after the '?' when doing a GET request.  If you want the form variables from a POST, then you can access them another way (I forget the details, since I usually just use Perl's CGI module or some similar thing for this).  If you want to do something based on URL parsing, I think you can do that, too, but you'll need to extract the entire URL (again, I forget the exact details).  You'll probably get better results if you ask the question that is behind your attempted solution, and look for the answer there.  My guess is that grabbing the QUERY_STRING is not the answer, if you really do need to use POST.
> 
> Mike
> 
> Wesley Leonard (marshall@pacdemon.org) wrote:
> > I'm having a weird issue...
> >
> > I'm trying to grab the QUERY_STRING environment variable in apache and it only
> > gets set when I use form method=GET.  I want to use POST...
> >
> > I've tried PHP and cgi (written in C) and both of them seem to behave the same.
> >
> > Is there an apache config option that turns this on/off?  Any other ideas?
> >
> > Thanks for your help.
> > --
> >
> > Wesley Leonard
> > marshall@pacdemon.org
> >
> > http://www.pacdemon.org
> > "The economy depends about as much on economists as the weather does on weather
> > forecasters."
> >     --Jean-Paul Kauffmann
> > _______________________________________________
> > Members mailing list
> > Members@kalamazoolinux.org
> > 
> 
> --
> Mike Slack
> mike@slacking.org
> --
> "If we knew what it was we were doing, it wouldn't
> be called research, would it?" --Albert Einstein
> _______________________________________________
> Members mailing list
> Members@kalamazoolinux.org
> 

-- 

Wesley Leonard
marshall@pacdemon.org

http://www.pacdemon.org
"The economy depends about as much on economists as the weather does on weather
forecasters." 
    --Jean-Paul Kauffmann