Home > Article > Backend Development > How to get member status on dedecms page
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: Welcome5d6de13d72aaedbc63d8db3198238499 Not logged in display: Please log in
##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}The above is the entire content of this article. I hope it will be helpful to everyone's study. For more related content, please pay attention to the PHP Chinese website! Related recommendations:
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!