why is this SIMPLE elseif not firing?

why is this SIMPLE elseif not firing?

am 16.07.2009 00:51:00 von Govinda

Sorry this is isn't good 'ninja' material.. but I gotta start where I
am.

this:

echo 'is set (EditExistingClient) ='. isset($EditExistingClient)."
>\n";
is returning:
is set (EditExistingClient) =1


but this, later down the page:
elseif ((isset($EditExistingClient)) || ($CreateClient)) //we just
created a client, OR edited a client
{
echo ''."\n";
}

is not firing unless $CreateClient is set.

This, too, is not firing when I think it should:
elseif (($EditExistingClient) || ($CreateClient)) //we just created a
client, OR edited a client
{
echo ''."\n";
}

what ridiculously simple thing am I missing?


------------
Govinda
govinda.webdnatalk@gmail.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: why is this SIMPLE elseif not firing?

am 16.07.2009 01:00:31 von Govinda

nevermind.. sorry for the noise.
It was my if clause that was firing too much, and never even reaching
that elseif.
-G

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: why is this SIMPLE elseif not firing?

am 16.07.2009 01:09:09 von List Manager

Govinda wrote:
> Sorry this is isn't good 'ninja' material.. but I gotta start where I am.
>
> this:
>
> echo 'is set (EditExistingClient) ='. isset($EditExistingClient)." > />\n";

I realize this is after the fact, but...

The above does not indicate WHAT it is set too. Just that it is set.

it could be set to /null/, FALSE, or 0 and they would all return false,
and fail, in your if condition later on.


> is returning:
> is set (EditExistingClient) =1

>
> but this, later down the page:
> elseif ((isset($EditExistingClient)) || ($CreateClient)) //we just
> created a client, OR edited a client
> {
> echo ''."\n";
> }
>
> is not firing unless $CreateClient is set.
>
> This, too, is not firing when I think it should:
> elseif (($EditExistingClient) || ($CreateClient)) //we just created a
> client, OR edited a client
> {
> echo ''."\n";
> }
>
> what ridiculously simple thing am I missing?
>
>
> ------------
> Govinda
> govinda.webdnatalk@gmail.com
>
>



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: why is this SIMPLE elseif not firing?

am 16.07.2009 01:34:28 von Govinda

> I realize this is after the fact, but...
>
> The above does not indicate WHAT it is set too. Just that it is set.
>
> it could be set to /null/, FALSE, or 0 and they would all return
> false,
> and fail, in your if condition later on.

I understand. I appreciate your taking the time to explain things.
You too Nathan!

-G


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: why is this SIMPLE elseif not firing?

am 16.07.2009 07:32:12 von Stut

2009/7/15 Govinda :
> Sorry this is isn't good 'ninja' material..  but I gotta start where=
I am.
>
> this:
>
> echo 'is set (EditExistingClient) =3D'. isset($EditExistingClient)."
>\n";
> is returning:
> is set (EditExistingClient) =3D1

>
> but this, later down the page:
> elseif ((isset($EditExistingClient)) || ($CreateClient)) //we just create=
d a
> client, OR edited a client
> {
> echo ' is
> Client">'."\n";
> }
>
> is not firing unless $CreateClient is set.
>
> This, too, is not firing when I think it should:
> elseif (($EditExistingClient) || ($CreateClient)) //we just created a
> client, OR edited a client
> {
> echo ' is
> Client">'."\n";
> }
>
> what ridiculously simple thing am I missing?

The only possibility I can see is that $EditExistingClient is getting
modified between the echo and the first elseif statement.

-Stuart

--=20
http://stut.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: why is this SIMPLE elseif not firing?

am 16.07.2009 07:33:40 von Stut

Oops, clearly too early in the morning to be looking at code. Sorry.

-Stuart

2009/7/16 Stuart :
> 2009/7/15 Govinda :
>> Sorry this is isn't good 'ninja' material..  but I gotta start wher=
e I am.
>>
>> this:
>>
>> echo 'is set (EditExistingClient) =3D'. isset($EditExistingClient)."
/>\n";
>> is returning:
>> is set (EditExistingClient) =3D1

>>
>> but this, later down the page:
>> elseif ((isset($EditExistingClient)) || ($CreateClient)) //we just creat=
ed a
>> client, OR edited a client
>> {
>> echo ' his
>> Client">'."\n";
>> }
>>
>> is not firing unless $CreateClient is set.
>>
>> This, too, is not firing when I think it should:
>> elseif (($EditExistingClient) || ($CreateClient)) //we just created a
>> client, OR edited a client
>> {
>> echo ' his
>> Client">'."\n";
>> }
>>
>> what ridiculously simple thing am I missing?
>
> The only possibility I can see is that $EditExistingClient is getting
> modified between the echo and the first elseif statement.
>
> -Stuart
>
> --
> http://stut.net/
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php