Thread
:
problem with PHP
View Single Post
05-10-2006, 08:38 AM
#
2
(
permalink
)
office politics
Dope Tech
Join Date: Jan 2004
Posts: 3,660
if a = 1 it displays a
then it evaluates the second if else
so since a is not 0, it echo's b
to prevent b from being displayed, put a else after echo a.
Code:
<? if ($a == 1) echo "a"; else { if ($a == 0) echo ""; else echo "b"; } ?>
__________________
Tech IMO.com
|
ExtremeTech.com
|
ASP Free.com
|
SysOpt.com
|
Tech Support Guy.org
DB Forums.com
|
Cyber Tech Help.com
|
Lazy Forums.com
|
Warrior Nation.net
'If you don't stand for somethin you'll fall for anything' - Dr. Dre
Been there, done that
office politics
View Public Profile
Send a private message to office politics
Find More Posts by office politics