[nycphp-talk] What is $QUERY_STRING ?

Matthew Zimmerman mz34 at
Tue Mar 11 12:25:33 EST 2003

No, I didn't know that Chris. Thanks a lot!! I am still a newbie so 
this is really  helpful.


On Tuesday, March 11, 2003, at 12:20  PM, Chris Shiflett wrote:

> --- Matthew Zimmerman <mz34 at> wrote:
>> I had tried GET, but i was only using print($QUERY_STRING) instead of
>> print ($_SERVER['QUERY_STRING']); When I added that it did, as you 
>> say,
>> bloom.
>> So what purpose is it serving in this code
>>> <form action="<?=$PHP_SELF?><?if($QUERY_STRING){ echo"?".
>>> $QUERY_STRING;}?>"method="POST">
>> if the method is POST?
> It may seem confusing due to the way PHP names its variables, but a 
> request can
> have both GET and POST variables. Your example above is the beginning 
> of a form
> that posts the form information to the current page. In case the 
> current page
> is, this code makes sure that the 
> form posts
> to blah.php?foo=bar instead of just blah.php.
> If you need to use anything in the query string, the $_GET array is 
> populated
> with each of the URL variables. You probably already know that, but I 
> thought
> I'd mention it.
> Chris
> --- Unsubscribe at ---
Matthew Zimmerman
Humanities Computing Group, NYU
Tel: 212.998.3038
Fax: 212.995.4120

More information about the talk mailing list