If and elseif and else never works for me, The help file doesn't say I'm wrong. Here is some code I've tried:
if ($user="asdf"){ print "asdf"; }else{ print "fdsa"; }
with or without user set to asdf, it prints asdf
if ($user == 'asdf'){ print "asdf"; }else{ print "fdsa"; }
you have to have == not = because there is stuff like
not equal: != equal: ==
i think there is more, i just dont know them
Originally posted by fahhem If and elseif and else never works for me, The help file doesn't say I'm wrong. Here is some code I've tried: if ($user="asdf"){ print "asdf"; }else{ print "fdsa"; } with or without user set to asdf, it prints asdf
try this:
if($user == "asdf") { print "asdf"; }else{ print "fdsa"; }
you can use either " or '(this ' only if there arent any variables inside it)