Re: IF ELSE problem on PHP4/WIN2K

From: Date: Fri, 10 Aug 2001 09:02:52 +0000
Subject: Re: IF ELSE problem on PHP4/WIN2K
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-8750@lists.php.net to get a copy of this message
Hi, [...] > BUT, if you leave either or both of the checkboxes empty (don't check them) > I get the following error: > > Warning: Undefined variable: CategoriesONE in > C:\inetpub\wwwroot\PrintUserForm.php on line 71 > Warning: Undefined variable: CategoriesTWO in > C:\inetpub\wwwroot\PrintUserForm.php on line 73 Not really an error. Don't worry about that. As it says it is only a Warning. If you set error_reporting to 7 or something below 15 (all) those warnings will disappear. The reason why your attempt with ELSE didn't work is that the variable is not created if the checkbox is not checked. So to achive what you want use isset() if (isset($CatONE)) { echo "One!!"; } else { // if $CatONE is not set == not existant echo "No Type set!"; } hope it helps Johannes

« previous php.windows (#8750) next »