Home  >  Article  >  Backend Development  >  How to get member status on dedecms page

How to get member status on dedecms page

不言
不言Original
2018-07-03 15:41:572222browse

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>&#39;;
}else{
echo &#39;
<p>
<a class="login-button" href="#">&#39;.$uid.&#39;</a> |<a class="join-button" href="<?php echo $cfg_memberurl; ?>/index_do.php?fmdo=login&dopost=exit">登出</a></p& gt;
&#39;;
}
{/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!

Statement:
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