The following is an example code for how to obtain member status on the dedecms page. Come and take a look together, I hope it will be helpful to everyone.
dedecms page example code of how to obtain member status
I made a corporate website a few days ago, and added member information to the navigation bar, such as :
Logged in: Display: Welcome
##The code is as follows:
{dede:php} require_once(DEDEMEMBER."/config.php"); $uid = $cfg_ml->M_LoginID; if(!$uid){ echo ' <p><a class="login-button" href="login.php">登录</a> |<a class="join-button" href="add.php">加入</a></p>'; }else{ echo ' <p> <a class="login-button" href="#">'.$uid.'</a> |<a class="join-button" href="<?php echo $cfg_memberurl; ?>/index_do.php?fmdo=login&dopost=exit">登出</a></p& gt; '; } {/dede:php}
About the implementation of adding redis to session
About the definition and usage of the php htmlentities() function
The above is the detailed content of How to get member status on dedecms page. For more information, please follow other related articles on the PHP Chinese website!