表格在第二页后切断页面

时间:2013-02-13 21:54:08

标签: php html forms

我不知道为什么但是我的桌子在第二个<td>标签后立即切断了......任何人都可以帮忙,我一遍又一遍地看着它。有人能帮我找到问题所在吗?

<tr>
    <td>Username:</td>
    <td>
        <input name="username" type="text" value='<?
            if($form->value("username")==""){
                echo($req_user_info["username"]);
            }else{
                echo $form->value("username");
            }
        ?>' size="56" maxlength="30">
    </td>
    <td>
        <? echo($form->error("username")); ?>
    </td>
</tr>
<tr>
    <td>New Password:</td>
    <td>
        <input name="newpass" type="password" value='<?
            echo($form->value("newpass"));
        ?>' size="56" maxlength="30">
    </td>
    <td>
        <? echo($form->error("newpass")); ?>
    </td>
</tr>

顺便说一下,那段代码只是前两行。

<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
?>
<form action="adminprocess.php" method="POST">
<table align="left" border="0" cellspacing="0" cellpadding="3">
<tr>
<td>Username:</td>
<td>
    <input name="username" type="text" value='<?php
        if($form->value("username")==""){
            echo($req_user_info["username"]);
        }else{
            echo $form->value("username");
        }
    ?>' size="56" maxlength="30">
</td>
<td>
    <?php echo($form->error("username")); ?>
</td>
</tr>
<tr>
<td>New Password:</td>
<td>
    <input name="newpass" type="password" value='<?php
        echo($form->value("newpass"));
    ?>' size="56" maxlength="30">
</td>
<td>
    <?php echo($form->error("newpass")); ?>
</td>
</tr>
<tr>
<td>Confirm New Password:</td>
<td><input name="conf_newpass" type="password" value='
<?php echo $form->value("newpass"); ?>' size="56" maxlength="30"></td>
<td><?php echo $form->error("newpass"); ?></td>
</tr>
</tr>
<td>Edit motto:</td>
<td><input type="text" size="56" name="motto" value='<?php
if($form->value("motto") == ""){
echo $req_user_info['motto'];
}else{
echo $form->value("motto");
}
?>'></td>
<tr>
<tr>
<td>Edit profile bio:</td>
<td><textarea cols="40" rows="10" name="profile" value=""><?php
if($form->value("profile") == ""){
echo $req_user_info['profile'];
}else{
echo $form->value("profile");
}
?></textarea></td>
<tr>
<tr>
<td>Email:</td>
<td><input name="email" type="text" value='
<?php
if($form->value("email") == ""){
echo $req_user_info["email"];
}else{
echo $form->value("email");
}
?>' size="56" maxlength="50">
</td>
<td><?php echo $form->error("email"); ?></td>
</tr>
<tr>
<td>User level:</td>
<td><input name="userlevel" type="text" value='
<?php
if($form->value("userlevel") == ""){
echo $req_user_info["userlevel"];
}else{
echo $form->value("userlevel");
}
?>' size="4" maxlength="10"></td>
<td><?php echo $form->error("userlevel"); ?></td>
</tr>
<tr><td align="right">
<input type="hidden" name="subedit" value="1">
<input type="hidden" name="usertoedit" value="<?php echo $usertoedit; ?>">
<input type="submit" name="button" value="Edit Account">
</td>
<td colspan="2" style="text-align:right;">
<input type="submit" name="button" value="Delete" onclick="return confirm ('Are you sure you want to delete this user, this cannot be undone?\n\n' + 'Click OK to continue or Cancel to Abort!')">
</td>
</tr>
</table>
</form>

1 个答案:

答案 0 :(得分:0)

我已经改变了你的语法..

<tr>
<td>Username:</td>
<td><input name="username" type="text" value="<?php echo htmlspecialchars(($form->value("username")=="" ? $req_user_info["username"] : $form->value("username"))); ?>" size="56" maxlength="30"></td>
<td><?php echo $form->error("username"); ?></td>
</tr>
<tr>
<td>New Password:</td>
<td><input name="newpass" type="password" value="<?php echo htmlspecialchars($form->value("newpass")); ?>" size="56" maxlength="30"></td>
<td><?php echo $form->error("newpass"); ?></td>
</tr>

对于其他php错误记录,请将其放在页面顶部:

<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
?>