Undefined index, Undefined variable, Undefined constant....

From: Date: Fri, 06 Sep 2002 07:26:58 +0000
Subject: Undefined index, Undefined variable, Undefined constant....
Groups: php.general 
Request: Send a blank email to php-general+get-115403@lists.php.net to get a copy of this message
I'm having trouble with the newest version of PHP (4.2.2). For example in a page I'm using the following code: if ($_GET['action'] == "logout") { //do something } But I'm getting an error message that says: ...log_message reports: PHP Notice: Undefined index: action in.... Ealier (other versions of PHP) I have succesfully used the above code, but do I now have to rewrite the code like this: if (isset($_GET['action']) AND $_GET['action'] == "logout") { //do something } Or am I totally wrong? This was just one example when I'm getting the message "Undefined index" or " Undefined variable" etc. A lot of code which has previously worked is now giving me loads of headache since I have to rewrite everything. Please, I need some help. my email: jwinberg@abo.fi

« previous php.general (#115403) next »