写了一个input输入,用户名和密码两个,运行的时候发现两个框里面出现了几个字符,我并没有写东西在里面呀,不知道怎么回事,求高手解答,谢谢!
————————————————
<tr valign="top">
  <td width="20%" align="right"  valign="top">用户名:</td> 
<td width="40%"><input name="username" type="text" id="username" value="<?php echo isset($_POST['username'])?trim($_POST['username']):""?>" size="16" maxLength="16" >
  <font color="#FF0000">**</font>
  <input type="button" name="Submit2" value="检查用户名" onClick="javascript:window.open('CheckUser.php?User='+document.register.username.value)">
<td width="40%"  class="p1">
<?php
if($userError) //判断用户名错误变量是否为1
{
echo $msg; //如果为1则显示错误提示信息
}else{
?>
<span class="bbc">用户名由<b>a~z</b>的英文字母(不区分大小写)、<b>0~9</b>的数字组成,首字符必须是字母,不区分大小写。长度为4-16个字符。用户名不能重复。注册成功后不可以修改。
</span>
<?php
}
?>
</td> 
</tr> 
<tr valign="top"> 
<td align="right"  valign="top"><font color="#000000">密 码:</td> 
<td><input name="password" type="password" id="password" size="16" maxLength="16" >** 
<td class="p1"><span class="bbc">密码为英文字母及数字组合,区分大小写。长度为6-16个字符。为了尽量保证密码的强壮,保护您的帐号安全,最好尽量复杂,例如至少要包含一个数字,至少也要包含一个字母。
</span></td> 
————————————————————
效果:

解决方案 »

  1.   

    多什么内容了?
    估计是乱码了
     <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
      

  2.   

    没发现什么问题。
    改下这个试试
    <input name="username" type="text" id="username" value="<?php echo isset($_POST['username'])?trim($_POST['username']):'';?>"双引号改为单引号
      

  3.   

    还有些标签没有闭合。例如<td><input name="password" type="password" id="password" size="16" maxLength="16" >**</td>
    少了红色的部分。<td width="40%"><input name="username" type="text" id="username" value="<?php echo isset($_POST['username'])?trim($_POST['username']):'';?>" size="16" maxLength="16" >这个也没有闭合。