On 15-Nov-2003,
christian9997@hotmail.com (christian9997) wrote:
[color=blue]
> I don't seem to understand the way isset works.
>
> Here is some Javascript code that makes a call using PHP:
>
> // USER CAME BACK TO CHANGE LANGUAGE
> if (<?echo isset($_REQUEST["changeLanguage"])?>) {
> alert("WORKS1");
> desiredLanguage = "<?echo $_REQUEST["changeLanguage"]?>";
> cookieIsSet = 2;
> }
>
> I am not passing any $_REQUEST["changeLanguage"] parameter!
> Here is the resulting HTML page source:
>
> // USER CAME BACK TO CHANGE LANGUAGE
> if () {
> alert("WORKS1");
> desiredLanguage = "";
> cookieIsSet = 2;
> }
>
> I thought isset should return false as it doesn't exist. Why is it
> returning nothing?[/color]
I guess it's returning null which is evaluates to false. You could add zero
to the result or use <? echo (isset(...))?'1':'0'; ?>
--
Tom Thackrey
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to
jamesbutler@willglen.net (it's reserved for spammers)