How to get member status on dedecms page

不言
Release: 2023-04-02 08:56:01
Original
2227 people have browsed it

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 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}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template