Re: verifying that a dropdown was selected
| From: | Alexander Deruwe | Date: | Thu, 05 Jul 2001 12:14:55 +0000 |
| Subject: | Re: verifying that a dropdown was selected | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-56286@lists.php.net to get a copy of this message | ||
On Thu, Jul 05, 2001 at 12:05:28PM +0200, Tom Gitzinger wrote:
> Hello Richard,
>
> I'm not quite sure but I think the problem is the following:
> - If no month has been specified, the variable $month is not defined.
> - If you then mention $month in
> if ($month == "")
> the Parser creates the variable. Its value is unpredictable, but it is
> most unlikely that
> it is an empty string ("").
>
> To solve the problem, you should be able to check whether the variable
> $month exists. I'm sorry I can't help you here because I've only started
> programming PHP but reading the function reference or something might help you.
You could check if it has been set by doing:
if (isset($month))
or even
if ($month)
(I'm not 100% sure about the last one, though..)
ad