CBaZ Posted August 1, 2007 Share Posted August 1, 2007 if ($_SESSION["permission"] <= "2") { ($_SESSION["username"]; Enjoy The Tunes!) } else { Quote Link to comment https://forums.phpfreaks.com/topic/62955-simple-if-statement/ Share on other sites More sharing options...
chronister Posted August 2, 2007 Share Posted August 2, 2007 if ($_SESSION["permission"] <= "2") { echo 'yes it is less than or equal to 2'; } else { echo 'no it is greater than 2'; } I am not sure what your trying to accomplish here... ($_SESSION["username"]; Enjoy The Tunes!) This is not an echo or a variable set statement. It does nothing. Also you need to make sure that you close any if / else statements otherwise you will get fatal error: unexpected end in the code Quote Link to comment https://forums.phpfreaks.com/topic/62955-simple-if-statement/#findComment-313471 Share on other sites More sharing options...
teng84 Posted August 2, 2007 Share Posted August 2, 2007 $variable= ($_SESSION["permission"] <= "2") ? ''.$_SESSION["username"]'..enjoy the tune':'default value'; Quote Link to comment https://forums.phpfreaks.com/topic/62955-simple-if-statement/#findComment-313481 Share on other sites More sharing options...
CBaZ Posted August 2, 2007 Author Share Posted August 2, 2007 ok here is what i am trying to do <? if (isset($_SESSION["logged"])) { &&(isset($_SESSION["permission"] <= "2") { ?> (<? echo $_SESSION["username"];?>: Enjoy The Tunes!)<br> <? } } else { ?> echo "<a href='register.php' onclick='NewWindow(this.href,'client_add','450','480','no');return false' class='field' onMouseOver='window.status='Register with the MaloriaN (PoP-UP)'; return true' onMouseOut='window.status='...:: M a l o r i a N -¤- E n t e r t a i n m e n t -¤- . N e t ::...'; return true' target='blank'>..Register..</a> For Future Benefits. </B></center>"; <? } ?> i know this isnt at all correct but everytime i break it down to fix it i run into more issues and can't even use the username display at all. Quote Link to comment https://forums.phpfreaks.com/topic/62955-simple-if-statement/#findComment-313499 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.