dedecms织梦模板模拟会员登录和退出代码
发布时间:2020-12-14 04:36:24 所属栏目:Dedecms 来源:网络整理
导读:首先模拟会员登录和退出,有两个重要文件,一个是include下的memberlogin.class.php和include/helpers下的cache.helper.php文件。 原理为:memberlogin.class.php通过使用缓存助手 helper('cache'),然后/member/config.php 文件引入memberlogin.class.php文
首先模拟会员登录和退出,有两个重要文件,一个是include下的memberlogin.class.php和include/helpers下的cache.helper.php文件。 原理为:memberlogin.class.php通过使用缓存助手 helper('cache'),然后/member/config.php 文件引入memberlogin.class.php文件实现模拟登录和退出。 模拟会员登录代码 ? 引入/member/config.php ? $cfg_ml->DelCache($cfg_ml->M_ID);//清除会员登录缓存 $cfg_ml->PutLoginInfo($mid);//让某用户登录 ? 模拟会员退出代码 ? 引入/member/config.php ? 查看源码打印代码帮助 $cfg_ml->DelCache($cfg_ml->M_ID);//清除会员登录缓存 $cfg_ml->ExitCookie();//退出当前登录用户 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |