Home  >  Article  >  Backend Development  >  如何呈现下面的结果

如何呈现下面的结果

WBOY
WBOYOriginal
2016-06-13 13:51:54984browse

怎么呈现下面的结果
我的意思是:有一个登陆页面,如果登录成功,check页面检查完之后跳转到主界面,然后主界面上可以出现,该登录成功的账号。这个怎么弄,有例子没

------解决方案--------------------
session
------解决方案--------------------

探讨

session

------解决方案--------------------
这个用cookie 就可以了。。
a.php
//post的数据做好过滤一下
if($_POST['name']=='aaa' and $_POST['pwd']=='bbb'){
setcookie("name",$_POST['name'],time()+3600,"/");
}
?>
然后b.php
echo $_COOKIE['name'];
?>
------解决方案--------------------
用session或cookie做都可以,登录成功之后,把这个人的数据记录下来就OK了,在首页加个判断进行显示就可以了。
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