[英]Compare User ID's and display a different output if they don't match?
I'm making a profile system and I've appeared to of hit a brick wall, I need to make it so if a user who's logged in is viewing their own profile then they'll have other options such as changing their profile picture, but if somebody else is logged in and is viewing somebody else's profile then the output for the profile will be different, just like Facebook or Twitter. 我正在制作个人资料系统,但似乎碰壁了,我需要这样做,如果登录的用户正在查看自己的个人资料,那么他们将拥有其他选择,例如更改个人资料图片,但是,如果其他人登录并正在查看其他人的个人资料,则个人资料的输出将不同,就像Facebook或Twitter。
I haven't got any code to show you otherwise I would. 我没有任何代码可以告诉您,否则我会显示。
if(md5($_GET['id']) == $_SESSION['id'])
{
echo "this is your profile";
}
else
{
echo "this is not your profile";
}
md5 session on login, not secure but better than saving anything in plain text 登录时使用md5会话,虽然不安全,但比以纯文本格式保存任何内容要好
on Login: $_SESSION['id'] = md5($id); 登录时:$ _SESSION ['id'] = md5($ id);
$id is from login or database. $ id来自登录名或数据库。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.