How phpcms determines whether the user is logged in:
First get the userid
and then determine whether it is empty
{if $userid} 。。。这里写已经登录之后的代码。。。 {else} {/if}
phpcms determines whether the user is logged in. The implementation code is in index.php of phpcms/modules/member/:
;;; '.get_nickname().' 欢迎回家 ;'.L('member_center').'; | ;发布信息; | ;'.L('logout').';'; $res["message"] = pc_base::load_config('system', 'charset') == 'gbk' ? iconv('utf-8', 'utf-8', $res["message"]) : $res["message"]; //get_nickname();//, } else{ $res["success"]=0; } if($jsoncallback){ echo $jsoncallback . "({\"items\":[".json_encode($res)."]})"; }else{ echo json_encode($res); } //echo json_encode($res); } } ?>
PHP Chinese website, a large number of freePHPCMS tutorials, welcome Online Learning!
The above is the detailed content of How does phpcms determine whether the user is logged in?. For more information, please follow other related articles on the PHP Chinese website!