如果用户没有登录,我有一些我不想让用户看到的按钮(如果$ _SESSION ['uid'] ='';)最好的方法是什么?
需要隐藏的按钮是:
<input type='button' id='forgothide' value='Forgot My Password' >
<input type='button' id='loginhide' value='Login' >
Run Code Online (Sandbox Code Playgroud)
在HTML/PHP代码中你只需要做...
[HTML bits...]
<?php
if(!$_SESSION['uid']) {
?>
<input type='button' id='forgothide' value='Forgot My Password' >
<input type='button' id='loginhide' value='Login' >
<?php
}
?>
[Other HTML bits...]
Run Code Online (Sandbox Code Playgroud)
......一切都应该好.