0

我不知道为什么,但是我的桌子在第二个标签之后就被切断了<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>
4

1 回答 1

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);
?>
于 2013-02-13T22:02:55.270 回答