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>