Home >CMS Tutorial >Empire CMS >How to use Empire CMS to determine whether a member is logged in
The example in this article describes the method of Empire CMS to determine whether a member is logged in. Some content can only be viewed after logging in, and cannot be viewed without logging in. At this time, you can refer to the code:
The code is as follows:
<?php include("e/class/connect.php"); $lguserid=intval(getcvar('mluserid'));//登陆用户ID $lgusername=RepPostVar(getcvar('mlusername'));//登陆用户 $lggroupid=intval(getcvar('mlgroupid'));//会员组ID if($lggroupid) //登陆会员显示菜单 { ?> //登陆后可以看到的内容。如:欢迎登录…… <?php } else //游客显示菜单 { ?> //没有登陆时可以看到的内容。如:我要注册 <?php } ?>
Recommended to study "Empire cms tutorial"
Note: You need to set the page to .php before you can use it.
I hope this article will be helpful to everyone’s Imperial CMS website building.
The above is the detailed content of How to use Empire CMS to determine whether a member is logged in. For more information, please follow other related articles on the PHP Chinese website!