squiblo Posted July 26, 2009 Share Posted July 26, 2009 the problems with this script are, - it does not show "myusername". - it does not hide the login form if i am logged in. <div id="wb_Text1" style="position:absolute;left:684px;top:55px;width:151px;height:14px;z-index:7" align="right"> <font style="font-size:13px" color="#FFFFFF" face="Arial">You are logged in as:</font><br> <font style="font-size:15px" color="#FF0000" face="Arial"> <?php if ($_SESSION['myusername']) {echo ucwords(strtolower($_SESSION['myusername'])); } else { ?></font></div> <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> <div id="wb_Text7" style="position:absolute;left:584px;top:66px;width:47px;height:16px;z-index:22" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial">Username:</font></div> <div id="wb_Text8" style="position:absolute;left:586px;top:91px;width:65px;height:16px;z-index:23" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial">Password:</font></div> <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/ Share on other sites More sharing options...
trq Posted July 26, 2009 Share Posted July 26, 2009 I see no call to session_start(). Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883049 Share on other sites More sharing options...
mmarif4u Posted July 26, 2009 Share Posted July 26, 2009 You have to use session_start() at top of the every page, where you use session variables. Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883061 Share on other sites More sharing options...
squiblo Posted July 26, 2009 Author Share Posted July 26, 2009 Now i have this and still not working correctly <?php session_start(); if ($_SESSION['myusername']) {echo ucwords(strtolower($_SESSION['myusername'])); } else { ?></font></div> <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> <div id="wb_Text7" style="position:absolute;left:584px;top:66px;width:47px;height:16px;z-index:22" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial">Username:</font></div> <div id="wb_Text8" style="position:absolute;left:586px;top:91px;width:65px;height:16px;z-index:23" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial">Password:</font></div> <div id="wb_Text2" style="position:absolute;left:669px;top:116px;width:111px;height:14px;z-index:7" align="left"> <font style="font-size:11px" color="#FFFFFF" face="Arial">Remember Me</font></div> <div id="wb_Text3" style="position:absolute;left:651px;top:134px;width:122px;height:14px;z-index:9" align="left"> <font style="font-size:11px" color="#FFFFFF" face="Arial">Forgot your password?</font></div> <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883075 Share on other sites More sharing options...
Xyphon Posted July 26, 2009 Share Posted July 26, 2009 Change if ($_SESSION['myusername']) To if (isset($_SESSION['myusername'])) Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883077 Share on other sites More sharing options...
squiblo Posted July 26, 2009 Author Share Posted July 26, 2009 ok now i have changed that, when i am logged in it shows my username but nothing else and it does not have any font to it, when i am logged off it shows the correct information. Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883085 Share on other sites More sharing options...
squiblo Posted July 26, 2009 Author Share Posted July 26, 2009 if you have a better way... show this if logged in: <div id="wb_Text1" style="position:absolute;left:684px;top:55px;width:151px;height:14px;z-index:7" align="right"> <font style="font-size:13px" color="#FFFFFF" face="Arial">You are logged in as:</font><br> <font style="font-size:15px" color="#FF0000" face="Arial"><?php echo ucwords(strtolower($_SESSION['myusername'])); ?></font></div> show this if logged out: <form action='checklogin.php' method='POST'> <input type="text" id="username" style="position:absolute;left:651px;top:59px;width:174px;font-family:Arial;font-size:13px;z-index:4" size="29" name="username" value="" title="username"> <input type="password" id="password" style="position:absolute;left:651px;top:86px;width:174px;font-family:Arial;font-size:13px;z-index:5" size="29" name="password" 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> <div id="wb_Text7" style="position:absolute;left:584px;top:66px;width:47px;height:16px;z-index:22" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial">Username:</font></div> <div id="wb_Text8" style="position:absolute;left:586px;top:91px;width:65px;height:16px;z-index:23" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial">Password:</font></div> <div id="wb_Text2" style="position:absolute;left:669px;top:116px;width:111px;height:14px;z-index:7" align="left"> <font style="font-size:11px" color="#FFFFFF" face="Arial">Remember Me</font></div> <div id="wb_Text3" style="position:absolute;left:651px;top:134px;width:122px;height:14px;z-index:9" align="left"> <font style="font-size:11px" color="#FFFFFF" face="Arial">Forgot your password?</font></div> Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883091 Share on other sites More sharing options...
squiblo Posted July 26, 2009 Author Share Posted July 26, 2009 everything i try doesnt work Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883207 Share on other sites More sharing options...
squiblo Posted July 26, 2009 Author Share Posted July 26, 2009 please can anyone help me out with this Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883246 Share on other sites More sharing options...
mmarif4u Posted July 26, 2009 Share Posted July 26, 2009 Post your updated code. Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883250 Share on other sites More sharing options...
squiblo Posted July 26, 2009 Author Share Posted July 26, 2009 <div id="wb_Text1" style="position:absolute;left:684px;top:55px;width:151px;height:14px;z-index:7" align="right"> <font style="font-size:13px" color="#FFFFFF" face="Arial">You are logged in as:</font><br> <font style="font-size:15px" color="#FF0000" face="Arial"> <?php session_start(); if ($_SESSION['myusername']) echo ucwords(strtolower($_SESSION['myusername'])); ?></font></div> <?php else { echo <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> <div id="wb_Text7" style="position:absolute;left:584px;top:66px;width:47px;height:16px;z-index:22" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial">Username:</font></div> <div id="wb_Text8" style="position:absolute;left:586px;top:91px;width:65px;height:16px;z-index:23" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial">Password:</font></div> <div id="wb_Text2" style="position:absolute;left:669px;top:116px;width:111px;height:14px;z-index:7" align="left"> <font style="font-size:11px" color="#FFFFFF" face="Arial">Remember Me</font></div> <div id="wb_Text3" style="position:absolute;left:651px;top:134px;width:122px;height:14px;z-index:9" align="left"> <font style="font-size:11px" color="#FFFFFF" face="Arial">Forgot your password?</font></div> } ?> Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883258 Share on other sites More sharing options...
mmarif4u Posted July 26, 2009 Share Posted July 26, 2009 Try this, still not sure..is this your whole code? <?php session_start(); if(isset($_POST['Login'])){ $_SESSION['myusername'] = $_POST['myusername']; } if($_SESSION['myusername']){ echo ucwords(strtolower($_SESSION['myusername'])); ?> </font></div> <?php } 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> <div id="wb_Text7" style="position:absolute;left:584px;top:66px;width:47px;height:16px;z-index:22" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial">Username:</font></div> <div id="wb_Text8" style="position:absolute;left:586px;top:91px;width:65px;height:16px;z-index:23" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial">Password:</font></div> <div id="wb_Text2" style="position:absolute;left:669px;top:116px;width:111px;height:14px;z-index:7" align="left"> <font style="font-size:11px" color="#FFFFFF" face="Arial">Remember Me</font></div> <div id="wb_Text3" style="position:absolute;left:651px;top:134px;width:122px;height:14px;z-index:9" align="left"> <font style="font-size:11px" color="#FFFFFF" face="Arial">Forgot your password?</font></div> <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883266 Share on other sites More sharing options...
squiblo Posted July 26, 2009 Author Share Posted July 26, 2009 that works when logged in but when not logged in it shows "you are logged in as:" but not the username or the login form Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883274 Share on other sites More sharing options...
squiblo Posted July 26, 2009 Author Share Posted July 26, 2009 <div id="wb_Text1" style="position:absolute;left:684px;top:55px;width:151px;height:14px;z-index:7" align="right"> <font style="font-size:13px" color="#FFFFFF" face="Arial">You are logged in as:</font><br> <font style="font-size:15px" color="#FF0000" face="Arial"> <?php session_start(); if(isset($_POST['Login'])){ $_SESSION['myusername'] = $_POST['myusername']; } if($_SESSION['myusername']){ echo ucwords(strtolower($_SESSION['myusername'])); ?> </font></div> <?php } 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> <div id="wb_Text7" style="position:absolute;left:584px;top:66px;width:47px;height:16px;z-index:22" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial">Username:</font></div> <div id="wb_Text8" style="position:absolute;left:586px;top:91px;width:65px;height:16px;z-index:23" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial">Password:</font></div> <div id="wb_Text2" style="position:absolute;left:669px;top:116px;width:111px;height:14px;z-index:7" align="left"> <font style="font-size:11px" color="#FFFFFF" face="Arial">Remember Me</font></div> <div id="wb_Text3" style="position:absolute;left:651px;top:134px;width:122px;height:14px;z-index:9" align="left"> <font style="font-size:11px" color="#FFFFFF" face="Arial">Forgot your password?</font></div> <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883278 Share on other sites More sharing options...
vineld Posted July 26, 2009 Share Posted July 26, 2009 Then you simply did not post that part of the code. You probably have some logical mistakes in another place... Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883282 Share on other sites More sharing options...
mmarif4u Posted July 26, 2009 Share Posted July 26, 2009 Try this: <?php session_start(); ?> <div id="wb_Text1" style="position:absolute;left:684px;top:55px;width:151px;height:14px;z-index:7" align="right"> <font style="font-size:13px" color="#FFFFFF" face="Arial">You are logged in as:</font><br> <font style="font-size:15px" color="#FF0000" face="Arial"> <?php if(isset($_POST['Login'])){ $_SESSION['myusername'] = $_POST['myusername']; echo ucwords(strtolower($_SESSION['myusername'])); ?> </font></div> <?php } 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> <div id="wb_Text7" style="position:absolute;left:584px;top:66px;width:47px;height:16px;z-index:22" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial">Username:</font></div> <div id="wb_Text8" style="position:absolute;left:586px;top:91px;width:65px;height:16px;z-index:23" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial">Password:</font></div> <div id="wb_Text2" style="position:absolute;left:669px;top:116px;width:111px;height:14px;z-index:7" align="left"> <font style="font-size:11px" color="#FFFFFF" face="Arial">Remember Me</font></div> <div id="wb_Text3" style="position:absolute;left:651px;top:134px;width:122px;height:14px;z-index:9" align="left"> <font style="font-size:11px" color="#FFFFFF" face="Arial">Forgot your password?</font></div> <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883284 Share on other sites More sharing options...
squiblo Posted July 26, 2009 Author Share Posted July 26, 2009 this is the full page script, it isnt long so maybe im doing something wrong somewhere else? <?php session_start(); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Squiblo - About Us!</title> <style type="text/css"> div#container { width: 900px; position: relative; margin-top: 0px; margin-left: auto; margin-right: auto; text-align: left; } body { text-align: center; margin: 0; } </style> </head> <body bgcolor="#E6E6E6" text="#000000"> <div id="container"> <div id="wb_Shape1" style="position:absolute;left:55px;top:41px;width:792px;height:125px;z-index:2" align="center"> <img src="/Images/header_img.jpg" id="Shape1" align="top" alt="" title="" border="0" width="792" height="125"></div> <div id="wb_Text1" style="position:absolute;left:60px;top:85px;width:325px;height:72px;z-index:3" align="left"> <font style="font-size:70px" color="#FFFFFF" face="impact"><a href="/index.php" style="text-decoration:none"> <font color="#FFFFFF">SQUIBLO</a></font></font></div> <div id="wb_Shape2" style="position:absolute;left:54px;top:170px;width:793px;height:412px;z-index:10" align="center"> <img src="/Images/body_img.jpg" id="Shape2" align="top" alt="" title="" border="0" width="793" height="412"></div> <?php session_start(); ?> <div id="wb_Text1" style="position:absolute;left:684px;top:55px;width:151px;height:14px;z-index:7" align="right"> <font style="font-size:13px" color="#FFFFFF" face="Arial">You are logged in as:</font><br> <font style="font-size:15px" color="#FF0000" face="Arial"> <?php if(isset($_POST['Login'])){ $_SESSION['myusername'] = $_POST['myusername']; echo ucwords(strtolower($_SESSION['myusername'])); ?> </font></div> <?php } 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> <div id="wb_Text7" style="position:absolute;left:584px;top:66px;width:47px;height:16px;z-index:22" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial">Username:</font></div> <div id="wb_Text8" style="position:absolute;left:586px;top:91px;width:65px;height:16px;z-index:23" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial">Password:</font></div> <div id="wb_Text2" style="position:absolute;left:669px;top:116px;width:111px;height:14px;z-index:7" align="left"> <font style="font-size:11px" color="#FFFFFF" face="Arial">Remember Me</font></div> <div id="wb_Text3" style="position:absolute;left:651px;top:134px;width:122px;height:14px;z-index:9" align="left"> <font style="font-size:11px" color="#FFFFFF" face="Arial">Forgot your password?</font></div> <?php } ?> <div id="copyright" style="position:absolute;left:55px;top:588px;width:150px;height:44px;z-index:32" align="left"> <font style="font-size:13px" color="#000000" face="Arial">Squiblo © 2009</font></div> <div id="about" style="position:absolute;left:185px;top:588px;width:150px;height:44px;z-index:33" align="left"> <font style="font-size:13px" color="#000000" face="Arial"><a href="/about.php"><font color=#000000>About Us</font></a></font></div> <div id="terms" style="position:absolute;left:285px;top:588px;width:150px;height:44px;z-index:34" align="left"> <font style="font-size:13px" color="#000000" face="Arial"><a href="/terms.php"><font color=#000000>Terms and Conditions</font></a></font></div> <div id="contact" style="position:absolute;left:450px;top:588px;width:150px;height:44px;z-index:35" align="left"> <font style="font-size:13px" color="#000000" face="Arial"><a href="/contact.php"><font color=#000000>Contact Us</font></a></font></div> <div id="privacy" style="position:absolute;left:555px;top:588px;width:150px;height:44px;z-index:36" align="left"> <font style="font-size:13px" color="#000000" face="Arial"><a href="/privacy.php"><font color=#000000>Privacy</font></a></font></div> <div id="help" style="position:absolute;left:640px;top:588px;width:150px;height:44px;z-index:36" align="left"> <font style="font-size:13px" color="#000000" face="Arial"><a href="/help.php"><font color=#000000>Help</font></a></font></div> </div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883285 Share on other sites More sharing options...
vineld Posted July 26, 2009 Share Posted July 26, 2009 You print "You are logged in as:" prior to checking anything at all so naturally that will be displayed....? What is the actual problem? Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883288 Share on other sites More sharing options...
squiblo Posted July 26, 2009 Author Share Posted July 26, 2009 when im not logged in it is not showing the login form Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883292 Share on other sites More sharing options...
mmarif4u Posted July 26, 2009 Share Posted July 26, 2009 Yup, agree what is the actual prob? At the mean time try this: <?php session_start(); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Squiblo - About Us!</title> <style type="text/css"> div#container { width: 900px; position: relative; margin-top: 0px; margin-left: auto; margin-right: auto; text-align: left; } body { text-align: center; margin: 0; } </style> </head> <body bgcolor="#E6E6E6" text="#000000"> <div id="container"> <div id="wb_Shape1" style="position:absolute;left:55px;top:41px;width:792px;height:125px;z-index:2" align="center"> <img src="/Images/header_img.jpg" id="Shape1" align="top" alt="" title="" border="0" width="792" height="125"></div> <div id="wb_Text1" style="position:absolute;left:60px;top:85px;width:325px;height:72px;z-index:3" align="left"> <font style="font-size:70px" color="#FFFFFF" face="impact"><a href="/index.php" style="text-decoration:none"> <font color="#FFFFFF">SQUIBLO</a></font></font></div> <div id="wb_Shape2" style="position:absolute;left:54px;top:170px;width:793px;height:412px;z-index:10" align="center"> <img src="/Images/body_img.jpg" id="Shape2" align="top" alt="" title="" border="0" width="793" height="412"></div> <div id="wb_Text1" style="position:absolute;left:684px;top:55px;width:151px;height:14px;z-index:7" align="right"> <font style="font-size:13px" color="#FFFFFF" face="Arial">You are logged in as:</font><br> <font style="font-size:15px" color="#FF0000" face="Arial"> <?php if(isset($_POST['Login'])){ $_SESSION['myusername'] = $_POST['myusername']; $username = $_SESSION['myusername']; echo ucwords(strtolower($username)); ?> </font></div> <?php } 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> <div id="wb_Text7" style="position:absolute;left:584px;top:66px;width:47px;height:16px;z-index:22" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial">Username:</font></div> <div id="wb_Text8" style="position:absolute;left:586px;top:91px;width:65px;height:16px;z-index:23" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial">Password:</font></div> <div id="wb_Text2" style="position:absolute;left:669px;top:116px;width:111px;height:14px;z-index:7" align="left"> <font style="font-size:11px" color="#FFFFFF" face="Arial">Remember Me</font></div> <div id="wb_Text3" style="position:absolute;left:651px;top:134px;width:122px;height:14px;z-index:9" align="left"> <font style="font-size:11px" color="#FFFFFF" face="Arial">Forgot your password?</font></div> <?php } ?> <div id="copyright" style="position:absolute;left:55px;top:588px;width:150px;height:44px;z-index:32" align="left"> <font style="font-size:13px" color="#000000" face="Arial">Squiblo © 2009</font></div> <div id="about" style="position:absolute;left:185px;top:588px;width:150px;height:44px;z-index:33" align="left"> <font style="font-size:13px" color="#000000" face="Arial"><a href="/about.php"><font color=#000000>About Us</font></a></font></div> <div id="terms" style="position:absolute;left:285px;top:588px;width:150px;height:44px;z-index:34" align="left"> <font style="font-size:13px" color="#000000" face="Arial"><a href="/terms.php"><font color=#000000>Terms and Conditions</font></a></font></div> <div id="contact" style="position:absolute;left:450px;top:588px;width:150px;height:44px;z-index:35" align="left"> <font style="font-size:13px" color="#000000" face="Arial"><a href="/contact.php"><font color=#000000>Contact Us</font></a></font></div> <div id="privacy" style="position:absolute;left:555px;top:588px;width:150px;height:44px;z-index:36" align="left"> <font style="font-size:13px" color="#000000" face="Arial"><a href="/privacy.php"><font color=#000000>Privacy</font></a></font></div> <div id="help" style="position:absolute;left:640px;top:588px;width:150px;height:44px;z-index:36" align="left"> <font style="font-size:13px" color="#000000" face="Arial"><a href="/help.php"><font color=#000000>Help</font></a></font></div> </div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883293 Share on other sites More sharing options...
squiblo Posted July 26, 2009 Author Share Posted July 26, 2009 ok basically my aim is to show the login form if the person is not logged in, and if the person is logged in i want it to show "you are logged in as: (username)" but what i am experience is that when i log in it shows "you are logged in as:(username)" just like it is supposed to, but when i am not logged in, it does not show the login form for me to login, and what it actually shows is "you are logged in:" but without the username at the end. Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883307 Share on other sites More sharing options...
mmarif4u Posted July 26, 2009 Share Posted July 26, 2009 Tried my last post code...Hope that should work.. Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883315 Share on other sites More sharing options...
squiblo Posted July 26, 2009 Author Share Posted July 26, 2009 http://www.squiblo.com/about.php this is what is shown when u are not logged in, the same thing is also show when logged in Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883321 Share on other sites More sharing options...
mmarif4u Posted July 26, 2009 Share Posted July 26, 2009 Can you PM me the username and pass to try. Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883327 Share on other sites More sharing options...
mmarif4u Posted July 26, 2009 Share Posted July 26, 2009 I tried it, its working fine... Try clear your browser cache and then check. EDIT: if you want to not show the 'you are logged in:" b4 login.. put that area in else statement. Quote Link to comment https://forums.phpfreaks.com/topic/167469-solved-else-problem/#findComment-883329 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.