gibigbig Posted April 23, 2007 Share Posted April 23, 2007 hey, im in a bit of a jam here. i've made a login script and integrated it in my website. the home page looks normal with the login box, but when u log in, the layout becomes all distorted and rearranged. I've looked over my layout design and everything seems ok so then something must be wrong with my code. my website is www.narutoking.com and a testing login is username: testing password: testing my code for the login script is <? include("session.php"); ?> <html> <title>Jpmaster77's Login Script</title> <body> <? if($session->logged_in){ echo "<strong>Logged in! </strong>"; echo "Welcome <b>$session->username</b>, you are logged in. <br><br>" ."[<a href=\"userinfo.php?user=$session->username\">My Account</a>] " ."[<a href=\"useredit.php\">Edit Account</a>] "; if($session->isAdmin()){ echo "[<a href=\"admin/admin.php\">Admin Center</a>] "; } echo "[<a href=\"process.php\">Logout</a>]"; } else{ ?> <? ?></h1> <form action="process.php" method="POST"> <table align="left" border="0" cellspacing="0" cellpadding="3"> <tr> <td width="68"><font size="2">Username:</font></td> <td width="174"><input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"></td> <td width="138"><font size="2"> <input name="submit" type="image" src="pics/loginbutton.gif"submit" value="Login"> </font><? echo $form->error("user"); ?><font size="2"> <input type="hidden" name="sublogin" value="1"> </font></td> </tr> <tr> <td><font size="2">Password:</font></td> <td><input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"></td> <td><? echo $form->error("pass"); ?> <input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?>> <font size="2"><font size="2">Remember me</font></font></td> </tr> <tr> <td colspan="2" align="left"><font size="2">[<a href="forgotpass.php">Forgot Password?</a>] Not registered? <a href="register.php">Sign-Up!</a></font></td> </tr> <tr> <td align="right"></td> </tr> <? } echo "</td></tr><tr><td align=\"center\"><br><br>"; ?> </table> </body> </html> please help Link to comment https://forums.phpfreaks.com/topic/48346-code-keeps-messing-up-my-layout/ Share on other sites More sharing options...
benjaminbeazy Posted April 23, 2007 Share Posted April 23, 2007 your login </table> tag is outside the conditional logged_in statement, thus closing whatever previous table was opening and fudging up your layout. that might not be exactly the problem, but you are opening a table with the login that you're not closing Link to comment https://forums.phpfreaks.com/topic/48346-code-keeps-messing-up-my-layout/#findComment-236392 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.