Re: Undefined Variable in formular... what happens???

From: Date: Tue, 18 Sep 2001 16:57:41 +0000
Subject: Re: Undefined Variable in formular... what happens???
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-67725@lists.php.net to get a copy of this message
Most likely it has to do with your error_reporting setting. See : http://uk.php.net/manual/en/phpdevel-errors.php#internal.e-notice http://uk.php.net/manual/en/features.error-handling.php Level E_NOTICE produces Warnings such as "Undefined Variable", so, doing the following : echo $iamnotset; Produces such a Error/Warning. Any "direct" use of $iamnotset will, which is why functions such as isset() and empty() exist : if (isset($var)) echo $var; I am guessing either you have : if ($submit) { // process form and no Warnings as $submit is set } else { // show form and WILL show the Warnings as $submit is not set } Consider : if (isset($submit)) { It's not uncommon to have E_NOTICE off but good little PHP developers develop with error_reporting turned up full blast, E_ALL in da house! Second, perhaps you expect register_globals to be on, see the following : http://uk.php.net/manual/en/configuration.php#ini.register-globals http://uk.php.net/manual/en/security.registerglobals.php If off, foo.php?fruit=apple will not create $fruit but rather, you'd go through a predefined variable like : $HTTP_GET_VARS['fruit']. http://uk.php.net/manual/en/language.variables.predefined.php Regards, Philip Olson On Tue, 18 Sep 2001, Ingo wrote: > hello > i am using win2000 xitami, php and access. so my problem is that the script > couldn't find the variable.. . > so i cant save the user changed buttons and editfields... > > is that a known problem with xitami and php? when i try > to run the script on a real webserver with .php installed, it works fine. > > thanx ingo > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#67725) next »