Re: isset bug?

From: Date: Fri, 22 Aug 2003 13:19:47 +0000
Subject: Re: isset bug?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-160435@lists.php.net to get a copy of this message
What I was trying to avoid is exactly that. It would require changing links and hidden fields throughout the entire application, which would take hours to track down. I am looking for a nice lazy and easy fix. "Curt Zirzow" <php-general@zirzow.dyndns.org> wrote in message news:20030822172636.GD56835@bagend.shire... > * 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 (#160435) next »