Re: How to check for a $_GET without throwing a Notice?

From: Date: Wed, 26 May 2004 21:43:41 +0000
Subject: Re: How to check for a $_GET without throwing a Notice?
Groups: php.general 
Request: Send a blank email to php-general+get-187021@lists.php.net to get a copy of this message
aslo you could change it to something else like this $_GET['id'] = $id; if (!$id) { // whatever you want to happen put here }
From: "Daniel Clark" <dclark@nwlink.com> Reply-To: "Daniel Clark" <dclark@nwlink.com> To: "Brian Dunning" <brian@briandunning.com>,"php-general@lists.php.net" <php-general@lists.php.net> Subject: Re: [PHP] How to check for a $_GET without throwing a Notice? Date: Wed, 26 May 2004 10:59:20 -0700 if (isset( $_GET['id']))
How do I check for the presence of an optional $_GET param without throwing a "Notice: Undefined index" when the param is not present? Tried all three of these, they all produce the Notice when the param is not passed: if ($_GET['id']) if ($_GET['id'] != "") if (isset $_GET['id']) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
_________________________________________________________________ MSN Toolbar provides one-click access to Hotmail from any Web page – FREE download! http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/

« previous php.general (#187021) next »