unknown gamer Posted May 20, 2008 Share Posted May 20, 2008 Ok i got this code and i got it on my site but if your not logged in the boxes are too long so i want them to go down a line i tried<p> and <br> but they don't work can someone help?to view what i mean go here:Link <body><table><tr><td><?include("include/session.php");/** * User has already logged in, so display relavent links, including * a link to the admin center if the user is an administrator. */if($session->logged_in){ echo "<h1>Logged In</h1>"; 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>Login</h1><?/** * User not logged in, display the login form. * If user has already tried to login, but errors were * found, display the total number of errors. * If errors occurred, they will be displayed. */if($form->num_errors > 0){ echo "<font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font>";}?><form action="process.php" method="POST"><table align="left" border="0" cellspacing="0" cellpadding="3"><tr><td>Username:</td><td><input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"></td><td><? echo $form->error("user"); ?></td></tr><tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"></td><td><? echo $form->error("pass"); ?></td></tr><tr><td colspan="2" align="left"><input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?>><font size="2">Remember me next time <input type="hidden" name="sublogin" value="1"><input type="submit" value="Login"></td></tr><tr><td colspan="2" align="left"><br><font size="2">[<a href="forgotpass.php">Forgot Password?</a>]</font></td><td align="right"></td></tr><tr><td colspan="2" align="left"><br>Not registered? <a href="register.php">Sign-Up!</a></td></tr></table></form><p><?}/** * Just a little page footer, tells how many registered members * there are, how many users currently logged in and viewing site, * and how many guests viewing site. Active users are displayed, * with link to their user information. */echo "</td></tr><tr><td align=\"center\"><br><br>";echo "<b>Member Total:</b> ".$database->getNumMembers()."<br>";echo "There are $database->num_active_users registered members and ";echo "$database->num_active_guests guests viewing the site.<br><br>";include("include/view_active.php");?></td></tr></table></body> Link to comment Share on other sites More sharing options...
murfitUK Posted May 22, 2008 Share Posted May 22, 2008 You could try setting your input type text boxes to a fixed width.<input type="text" name="user" maxlength="30" value="..." style="width: 140px; font-size: 90%; (etc)" />Or as you've put the login field inside a table <td> you could also try ... style="width: 95%;" For that though I would suggest putting the text "Username:" and the input field on separate lines (Maybe separated by a <br />). The problem you will have is a user's default text/screen size. If you set the input type to a fixed width it might look nice on your screen but might still be too large, or too small, on someone elses. Link to comment Share on other sites More sharing options...
unknown gamer Posted May 22, 2008 Author Share Posted May 22, 2008 ya, i'm trying to put them on separate lines, it's not working with <br /> Link to comment Share on other sites More sharing options...
justsomeguy Posted May 22, 2008 Share Posted May 22, 2008 What are you trying to show on separate lines? You're using a table for layout, so if you have a bunch of items in the same row then using <br> isn't going to put one below the other, they are in the same table row. It would just make the entire row taller. Link to comment Share on other sites More sharing options...
unknown gamer Posted May 22, 2008 Author Share Posted May 22, 2008 if you go on my website Hereyou can see that the login bars are too long, i like the size i just want both of them moved down so instead of it being like this:username: herepassword: herei want this:usernamer:herepassword:here-thanks Link to comment Share on other sites More sharing options...
justsomeguy Posted May 23, 2008 Share Posted May 23, 2008 The text and the fields are in two different cells in the same table row:<tr><td>Username:</td><td><input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"></td><td><? echo $form->error("user"); ?></td></tr><tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"></td><td><? echo $form->error("pass"); ?></td></tr>You should also add a size to the inputs to make them exactly how big you want them instead of using the browser default. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.