页面跳转的问题

浏览:2363 发布日期:2014/05/02 分类:求助交流
登录成功后,想跳转到主页面可是说什么也没反应。代码是:        public function doLogin(){
        header('Content-Type:text/html;charset=utf-8');
        $model=M("users");
        $user=$model->where("user_name='{$_POST['user_name']}'")->find();
        if($user!=null){
            if($user["user_password"]!=$_POST["user_password"]){
                echo "<script>alert('密码不正确');window.location.href='index/index'</script>";
                die;
            }
            session_start();
            $_SESSION["user_name"]=$user["user_name"];
             $this->redirect("index");
        }else{
            echo "<script>alert('不存在此用户');window.location.href='index/index'</script>";    
        }
    }
另外发现个问题:
我的登录界面的网址是:http://localhost/wms/index.php/Home/Index/login.html,是不是那个login不应该有那个。html后缀啊,我用的是thinkphp3.2.2版本.
最佳答案
评论( 相关
后面还有条评论,点击查看>>