Home > Backend Development > PHP Tutorial > 如何让登录模块在登录前显示登录界面,登录后显示用户信息呢?

如何让登录模块在登录前显示登录界面,登录后显示用户信息呢?

WBOY
Release: 2016-06-23 13:49:31
Original
1622 people have browsed it

我知道是通过session判断,就是在session通过后模板方面怎么变成用户登录的信息呢


回复讨论(解决方案)

用户信息完全写入session 模板判断决定是输出session中的用户信息还是登陆框

我一般是采用session来进行判断后显示对应状态的内容,要是你想效果更好点可以采用js来进行判断使用。

登陆保存
session_start();
$_SESSION['username'] = $_POST['username'];


页面显示
session_start();
echo $_SESSION['username'];

很简单的,就是用session

if判断呗   直接 php echo  HTML代码

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template