如何在php中显示返回用户的消息? [英] How to display message for returning user in php?

查看:91
本文介绍了如何在php中显示返回用户的消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在php中创建了一个登录脚本,用户可以在其中注册然后登录以访问私人页面。登录用户可以在私人页面上看到他们的用户名 - welcome:username。一切正常。问题是我想显示欢迎回复:当用户再次登录时私人页面上的用户名消息。我试过谷歌但没有成功。请帮助,它背后的逻辑是什么?

Hi, i have created a login script in php where user can register and then login to access the private page. Logged in users can see their username on private page-"welcome:username" . All working fine. Problem is i want to display welcome back:username message on private page when users logged in again. I have tried google but no success. Please help, whats the logic behind it?

推荐答案

我认为您可以尝试在SQL表中添加一个列,当用户首次登录时值会发生变化(例如列登录时为TRUE或FALSE / 1或0值)...



您可以查看此图片http://s13.postimg.org/yuquyht1j/Capture.png [ ^ ]



所以逻辑是你必须在用户优先时在登录栏中插入值1 login和你的auth func必须检查login列的值是1还是0 ......



我认为这是最简单的技巧......
I think you can try to add a column in your SQL table where the value change when the user first login (example TRUE or FALSE / 1 or 0 value from column Login)...

You can look this pic http://s13.postimg.org/yuquyht1j/Capture.png[^]

So the logic is you must INSERT value 1 in "login" column when user first login and your auth func must check whether the value of "login" column is 1 or 0...

I think this is the simplest trick...


我有一个替代的简单方法,而不使用数据库。

用户登录时他/她的用户名不是?

所以从表格中读取用户名,



if(isset(
I have an alternative easy method to it without using database.
The user is login with his/her user name isn't?.
So read username from form,

if(isset(


_请求['用户名')&& isset(
_REQUEST['username') && isset(


这篇关于如何在php中显示返回用户的消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆