Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strange isset behavior

Status
Not open for further replies.

skiflyer

Programmer
Sep 24, 2002
2,213
US
I have two machines... the first

IIS 4.0
PHP 4.3.0

The second
Apache 2.0.44
PHP 4.3.1

Running the same script... I'm porting the IIS machine over to Apache...

and one of my php functions says
if (isset($_SERVER["QUERY_STRING"])) {

...

}

On the IIS/4.3.0 box this behaves as expected...
On the Apache box this always returns true, even when the query_string is clearly blank... in fact part of this function displays the query string, and it's blank there too.

Anyone know about this, have experience with it? Is it part of the experimental support for Apache 2? Am implementing a hack workaround... but was hoping there's a better way.

Thanks,
Rob
 
If I remember correctly, the [tt]QUERY_STRING[/tt] environmental variable should always be set, even if there is no query string. You may want to use [tt]empty()[/tt] along with [tt]isset()[/tt]. //Daniel
 
Yeah, that was my workaround... so apparently it was IIS which was being peculiar by letting me get away with just isset.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top