Re: isset bug?

From: Date: Fri, 22 Aug 2003 17:26:36 +0000
Subject: Re: isset bug?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-160430@lists.php.net to get a copy of this message
* Thus wrote Christian Calloway (callowaylc@yahoo.com): > Ok, here's the deal. I like to use $_GET and $_POST variables without values > to notify my scripts that some action must be taken. For example, given the > following URL: > > http://blahdomain/blah.php?productid=1&edit > > or given the following form element: > > <input type=hidden name="edit"> simply add a value="1" and it will fix your problem. > > My blah.php script will check if edit set using the following line: > > if (isset($_REQUEST["edit"])) > { > .. > } > > and then it will take the appropriate actions (lets just say its updating a > record in the database). Locally I am running PHPv4.3.2, and everything > works fine. I have been working on a large web-based application for the > last month, and yesterday I put it up live. Our host unfortunately runs > PHPv4.2.1 and I have no access to the conf files (those bastards) and > globals are set to on. Low and behold, the isset function returns false when > a $_POST or $_GET variable is passed but contains no value, which would be > exactly the same thing as checking the variable itself: > Curt -- "I used to think I was indecisive, but now I'm not so sure."

« previous php.general (#160430) next »