Help to determine whether the session landing problem!

Source: Internet
Author: User
I would like to ask if I judge how not to execute!


注册会员
会员登录

{session('user_name')}
This is a static page, this is what the controller says. if ($result && $result['password'] == $result['password']) {
// 存储session
session('uid', $result['user_id']); // 当前用户id
session('user_name', $result['user_name']); // 当前用户名
session('lastdate', $result['lastdate']); // 上一次登录时间
session('lastip', $result['lastip']); // 上一次登录ip
// 更新用户登录信息
$where['user_id'] = session('uid');
M('user')->where($where)->setInc('loginnum'); // 登录次数加 1
M('user')->where($where)->save($data); // 更新登录时间和登录ip
$this->success('登录成功,正跳转至系统首页...', U('Home/User/user'));
}
else {
$this->error('登录失败,用户名或密码不正确!');
}
}

123.jpg(10.92 KB downloaded: 0 times)

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.