会员中心全局对象$cfg_ml
通过$cfg_ml对象可以获取会员的相关信息,我们打印出print_r($cfg_ml) 查看数组包含哪些变量。- (
- [M_ID] => 1
- [M_LoginID] => admin
- [M_MbType] => 个人
- [M_Money] => 0
- [M_Scores] => 10000
- [M_UserName] => admin
- [M_Rank] => 100
- [M_Face] =>
- [M_LoginTime] => 1393946471
- [M_KeepTime] => 604800
- [M_Spacesta] => 0
- [fields] => Array
- (
- [mid] => 1
- [mtype] => 个人
- [userid] => admin
- [pwd] => 21232f297a57a5a743894a0e4a801fc3
- [uname] => admin
- [sex] => 男
- [rank] => 100
- [uptime] => 0
- [exptime] => 0
- [money] => 0
- [email] =>
- [scores] => 10000
- [matt] => 10
- [spacesta] => 0
- [face] =>
- [safequestion] => 0
- [safeanswer] =>
- [jointime] => 1376494666
- [joinip] =>
- [logintime] => 1393946471
- [loginip] => 127.0.0.1
- [checkmail] => -1
- [honor] => 上校
- )
- [isAdmin] => 1
- [M_UpTime] => 0
- [M_ExpTime] => 0
- [M_HasDay] =>
- [M_JoinTime] => 2013-08-14
- [M_Honor] => 上校
- [memberCache] => memberlogin
- )
通过输出对象属性来输出会员信息
- echo $cfg_ml->M_UserName; //用户名
- echo "";
- echo $cfg_ml->M_ID; //身份ID
- echo "";
- echo $cfg_ml->M_MbType; //类型
- echo "";
- echo $cfg_ml->M_Money; //金币
- echo "";
- echo $cfg_ml->M_Scores; //积分
- echo "";
- echo $cfg_ml->M_UserName; //用户名
- echo "";
- echo $cfg_ml->M_Rank; //会员等级
- echo "";
- echo $cfg_ml->M_Face; //会员头像
- echo "";
- echo $cfg_ml->M_LoginTime; //登录时间
- echo "";
- echo $cfg_ml->M_KeepTime;
- echo "";
- echo $cfg_ml->M_Spacesta;
- echo "";
- echo $cfg_ml->M_Honor;
- echo "";
- echo $cfg_ml->fields['sex']; //性别
- echo "";
- echo $cfg_ml->fields['email']; //邮箱
- echo "";
- echo $cfg_ml->fields['honor'];
- echo "";
- echo $cfg_ml->fields['matt'];
转载请注明来源网址:青锋建站-http://www.sjzphp.com/kaifazhe/dedecms/shuchu_member_1452.html