View Single Post
Old 05-10-2006, 08:38 AM   #2 (permalink)
office politics
Dope Tech
 
Join Date: Jan 2004
Posts: 3,660
Send a message via ICQ to office politics Send a message via AIM to office politics Send a message via Yahoo to office politics
Default

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 is offline   Reply With Quote