Please help to determine whether the session is logged in!

WBOY
Release: 2016-10-22 12:06:40
Original
1274 people have browsed it

I would like to ask why my if judgment is not executed!

<if condition="session('uid') eq null"><br>              <a href="__APP__?m=User&a=register" class="menulink">Register Member</a> <br>               <a href="__APP__?m=User&a=login" class="menulink">Member login</a><br>                                                                                                       <a href="__APP__?m=User&a=user" class="menulink">{session('user_name')}</a><br>              </if><br>This is a static page, the controller is written like this if ($result && $result['password'] == $result['password']) {                                                                                                                                              session('uid', $result['user_id']);                    session('user_name', $result['user_name']); // Current username<br>                    session('lastdate', $result['lastdate']); // Last login time<br>                 session('lastip', $result['lastip']);                                                                                                                                                                                         $where['user_id'] = session('uid');<br>                 M('user')->where($where)->setInc('loginnum'); // Add 1 to the number of logins<br>                    M('user')->where($where)->save($data); // Update login time and login ip<br>                       $this->success('Login successful, jumping to the system homepage...', U('Home/User/user'));<br>                } <br>                else {<br>                            $this->error('Login failed, username or password is incorrect!');<br>             }<br>           }<br> <br> <br> 123.jpg <br>( 10.92 KB Download: 0 times )<br>

Please help to determine whether the session is logged in!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template