Login/LoginAction.class.php

来源:互联网 发布:酒店管理系统sql语句 编辑:程序博客网 时间:2024/06/07 02:52
<?php
// 本类由系统自动生成,仅供测试用途
class LoginAction extends Action {
    public function index(){
$this->display();
    }
function do_login(){
//dump($_SESSION);
$username=$_POST['username'];
$password=$_POST['password'];
$code=$_POST['code'];
if($_SESSION['verify'] !== md5($code)){
$this->error("验证码错误!");
}
$m=M('User');
$where['username']=$username;
$where['password']=$password;
$i=$m->where($where)->count();
if($i > 0) {
$this->redirect('User/index');
}else{
$this->error('该用户不存在');
}
}
}
0 0
原创粉丝点击