squiblo Posted July 26, 2009 Share Posted July 26, 2009 i need a php code to show this if somebody is logged in: <?php echo ucwords(strtolower($_SESSION['myusername'])); ?> or if they are not logged in show this: <form name="form1" method="post" action="checklogin.php"> <input type="text" id="myusername" style="position:absolute;left:651px;top:59px;width:174px;font-family:Arial;font-size:13px;z-index:4" size="29" name="myusername" value="" title="username"> <input type="password" id="mypassword" style="position:absolute;left:651px;top:86px;width:174px;font-family:Arial;font-size:13px;z-index:5" size="29" name="mypassword" value="" tabindex="password" title="password"> <input type="checkbox" id="Checkbox1" name="Checkbox1" value="on" style="position:absolute;left:648px;top:113px;font-family:Arial;font-size:13px;z-index:6"> <input type="submit" id="Button1" name="Login" value="Login" style="position:absolute;left:778px;top:117px;width:50px;height:43px;font-family:Arial;font-size:13px;z-index:8" title="Login"> </form> i would prefere i without "inclusde" if possibe, please help i dont know where to start Quote Link to comment https://forums.phpfreaks.com/topic/167462-solved-if-logged-in/ Share on other sites More sharing options...
mmarif4u Posted July 26, 2009 Share Posted July 26, 2009 <?php if ($_SESSION['myusername']){ echo ucwords(strtolower($_SESSION['myusername'])); } else { ?> <form name="form1" method="post" action="checklogin.php"> <input type="text" id="myusername" style="position:absolute;left:651px;top:59px;width:174px;font-family:Arial;font-size:13px;z-index:4" size="29" name="myusername" value="" title="username"> <input type="password" id="mypassword" style="position:absolute;left:651px;top:86px;width:174px;font-family:Arial;font-size:13px;z-index:5" size="29" name="mypassword" value="" tabindex="password" title="password"> <input type="checkbox" id="Checkbox1" name="Checkbox1" value="on" style="position:absolute;left:648px;top:113px;font-family:Arial;font-size:13px;z-index:6"> <input type="submit" id="Button1" name="Login" value="Login" style="position:absolute;left:778px;top:117px;width:50px;height:43px;font-family:Arial;font-size:13px;z-index:8" title="Login"> </form> <?php } ?> Is this what you are looking for? Quote Link to comment https://forums.phpfreaks.com/topic/167462-solved-if-logged-in/#findComment-883025 Share on other sites More sharing options...
squiblo Posted July 26, 2009 Author Share Posted July 26, 2009 problem solved! Quote Link to comment https://forums.phpfreaks.com/topic/167462-solved-if-logged-in/#findComment-883036 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.