Would you also post a link to a live page, and a more explicit description of the expected and actual behaviors?
Edit:
The first problem I notice is in the line:
PHP:
echo "</td></tr><tr><td colspan=\"2\" align=\"left\"> <input type=\"checkbox\" name='remember' /";
The last "/" is for a self closing tag. If
$form->value("remember") != "", then the "checked" attribute you later print is coming after the "/", resulting in invalid HTML.
You can also write the code with no
echos, which you may find more readable:
HTML:
<?php
if(!$session->logged_in){ ?>
<form action="loginsystem/process.php" method="post" >
<table align="left" border="0" cellspacing="0" cellpadding="3">
<tr><td> Username:</td>
<td><input type="text" name="user" size="13" maxlength="30" value="<?php echo $form->value("user"); ?>" /></td>
<td><?php echo $form->error("user"); ?></td></tr>
<tr><td> Password:</td>
<td><input type="password" name="pass" size="13"maxlength="30" value="<?php echo $form->value("pass"); ?>" /></td>
<td><?php echo $form->error("pass"); ?></td></tr>
<tr><td colspan="2" align="left"> <input type="checkbox" name='remember'
<?php
if ($form->value("remember") != "") {
echo "checked";
}
?>> Remember me next time <br /><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="loginsystem/forgotpass.php" >Forgot Password?</a>]</font></td>
<td align="right"> </td></tr>
<tr><td colspan="2" align="left"> Not registered? <a href="loginsystem/register.php" >Sign-Up!</a></td></tr>
</table>
</form>
<?php } ?>
Don't use a
table based layout, nor should you use " " for layout. You can usually find a better way than using <br />.