Re: Why won`t this work??
| From: | Alexander Wagner | Date: | Sun, 21 Jan 2001 10:36:09 +0000 |
| Subject: | Re: Why won`t this work?? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-35889@lists.php.net to get a copy of this message | ||
Website4S@aol.com wrote:
> Hi,
>
> Can anyone tell me before I rip my hair out, why this won`t work??
>
> if (!UN)
> {
> printf("<SCRIPT LANGUAGE='JAVASCRIPT'>alert('Please enter a User
> Name.');self.history.back();</SCRIPT>");
> }
>
> TIA
> Ade
An undefined constant will return true. You have to explicitly define
it as 0 to make this work.
I guess this is becauese PHP interpretes it as a string, and all
strings but '' are true. It has to, because it doesn't know it is a
constant.
Wagner
--
Three may keep a secret, if two of them are dead.