Home  >  Article  >  Backend Development  >  使用session判断用户登录用户权限(超简单)_PHP教程

使用session判断用户登录用户权限(超简单)_PHP教程

WBOY
WBOYOriginal
2016-07-21 15:08:311046browse

如下所示:

复制代码 代码如下:


用户名:

密  码:



session_start();
$_SESSION["user"]=$_POST[user];
$_SESSION["password"]=$_POST[pwd];
if($_SESSION[user]==""){
 echo "";
}

if($_SESSION["user"]=="admin"){
 echo "当前登录:系统管理员
用户管理";
}else{
 echo"当前登录:".$_SESSION[user]."
我的相册";
}
?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/327477.htmlTechArticle如下所示: 复制代码 代码如下: form action="#" method=post 用户名:input type=text name=userbr 密 码: input type=password name=pwdbr input type=submit name=sbum...
Statement:
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