【求助】用户名的数据没有传进去,显示为NULL,而密码、邮箱等数据可以,不知道是何原因,请大虾们指教……

我测试了一下,发现用户名总是传不进去,输出变量信息显示为NULL,而当我把模型中uname的自动验证代码注释掉后,发现密码、邮箱等都可以传进去。我就认为是uname的那代码的问题,可是怎么改也解决不了,还是总是提示“用户名必须填写”,不知到是什么原因,还请各位指教!下面是我的代码.
下面是User控制器
<?php
class UserAction extends CommonAction{
    function index() {
        $user=new UserModel();
        $list=$user->select();
        $this->assign('title','用户列表');
        $this->assign('ulist',$list);
        $this->display();
    }
    /*
     *创建用户
     */
    function add() {
         $this->display();
    }
    /*
     *插入数据
     */
    function insert() {
    //创建用户类型
         $user = new UserModel();
         if($data = $user->create()){
              echo "创建成功!";
         }else{
               echo "创建失败!";
               echo $user->getError();
               dump($var, $echo=true, $label=null) ;//输出变量信息
         }
    }
    function edit() {
      $this->display();
    }
}
?>
下面是User模型
<?php
class UserModel extends Model{
  //表单的数据验证
  protected $_validate   =  array(
     array('uname','require','用户名必须填写!',1,'regex',3),
     //array('uname','','用户名已经存在!',1,'unique',1),
     array('pwd','require','密码必须填写!'),
     array('email','email','邮箱格式错误!'),
     array('active',array(0,1),'数据错误!',0,'in'),
     //array('pwd','checkPwd','密码长度不够6位!',1,'function'),
     array('pwd','checkPwd','密码长度不够6位!',1,'callback'),
     );

   function checkPwd(){
    $password = $_POST['pwd'];
    if(strlen($password)>=6){
        return true;
    }else{
        return false;
    }
  }
   /*表单项与字段的映射(主要是为了安全性考虑)*/
   protected $_map = array(
     'uname' => 'username',
     'pwd'   => 'password',
   );
   //数据的自动完成
   protected $_auto = array(
        //array(填充的字段,填充的内容,填充的条件,附加规则)
     array('reg_date','getDate',1,'callback'),
     array('password','md5',1,'function'),
   );
   function getDate(){
    return date('Y-m-d H:i:s');
   }
}
?>
下面是add模板
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset="UTF-8" />
<title>创建用户</title>
</head>
<body>
<form action="__URL__/insert" method="post">
用户名:<input type="text" name="uname" /><br />
密码:<input type="password" name="pwd" /><br />
昵称:<input type="text" name="name" /><br />
邮箱:<input type="text" name="email" /><br />
激活:是<input type="radio" name="active" value="1" checked="checked" />
     否<input type="radio" name="active" value="0" /><br />
<input type="submit" value="保存" />
</form>
</body>
</html>

作者: maybezi   发布时间: 2011-08-14

求解决啊,我有看了一下午还是不知道是什么原因,还请那位大侠帮忙解决一下,万分感激!!!!!!!

作者: maybezi   发布时间: 2011-08-14