• 技术文章 >后端开发 >php教程

    thinkphp会员登录有关问题

    2016-06-13 12:40:27原创374
    thinkphp会员登录问题
    
    session_start();
    header('Content-Type:text/html; charset=utf-8');
    class AdminAction extends Action{
    public function index(){
    if(isset($_POST['username'])){
    if(isset($_POST['username'])&&isset($_POST['password'])){
    $db=M();
    $select=$db->query("select * from developers where username=".$POST['username']." and password=".$_POST['password']."");
    if($select){
    $_SESSION['admin']=$_POST['username'];
    $this->redirect('Index/index','',2,'用户'.$_POST['username'].'登录成功!');
    }else{
    $this->redirect('Index/index','',2,'用户名或者密码不正确');
    }
    }else{
    $this->redirect('Index/index','',2,'用户名或密码不能为空!');
    }
    }
    $this->display();
    }



    }
    ?>

    这是AdminAction代码,不知道怎么回事,不管输入什么或者不输人它都提示用户名或者密码不正确,为什么呢?哪的问题?

    Web大前端开发直播班

    相关文章推荐

    • php js 文本框 值增减有关问题• PHP的mcrypt模块装配• php与redis施用经验分享• 请教 zend框架 怎么 整合 FCKeditor编辑器啊• php基础学习- 一些废弃的用法封锁提高性能

    全部评论我要评论

  • 取消发布评论发送
  • 1/1

    PHP中文网