$user=new UserModel();
$username=I('post.username','notfind','htmlspecialchars');
if($user->where("username='{$username}'")->select()){
$this->ajaxReturn($username,'用户名已存在',1);
}else{
if ($user->create ()) {
$res=$user->add();
if($res){
$this->success('success','__URL__/index');
}
}
}在其他模块使用success是成功的 最佳答案