如何保护页面以要求登录以访问它们 [英] How to secure pages to require login to access them

查看:108
本文介绍了如何保护页面以要求登录以访问它们的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨再次,我完成登录表单一切正常,所以我只想知道如何使welcomein.php私有?我正在建立一个社区,所以你会知道我的意思是,有人可以给我一个简单的脚本,我可以更好地发展。

所以PLIZ给我的脚本以及如何在数据库中加密密码的脚本


谢谢。

hi again, i am done with the login form everything works fine so i just want to know how to make the welcomein.php private?? i am working on a community so you would know what i mean could some one give me a simpel script that i can develope to better.
so pliz give me the script for that and the script for how to make a password encrypted in the database

Thanks.

推荐答案

更改了主题标题以更好地描述问题(您是否知道那些标题不符合发布指南实际上得到了FEWER回复?)。


Heya,silmana。

如何实现这一点在很大程度上取决于你。通常接受的方法是在_SESSION中放置某种登录指示器,然后在加载受限页面时检查它。


例如,你当用户登录时,可能设置
Changed thread title to better describe the problem (did you know that threads whose titles that do not follow the Posting Guidelines actually get FEWER responses?).

Heya, silmana.

How you implement this is largely up to you. The generally-accepted way to do this is to put some kind of logged-in indicator in the _SESSION, which you would then check for when loading a restricted page.

For example, you might set


_SESSION [''logged_in''] = true。


然后,当加载受限制的页面时,你可以在顶部添加此代码:
_SESSION[''logged_in''] = true when the User logs in.

Then, when loading a restricted page, you can add this code at the top:
展开 | 选择 | Wrap | 行号





安全目的你可以使用md5功能。


md5是一个在途中加密算法,在将数据存储到数据库之前使用md5加密它,并在登录时验证它。
Hi

For the security purpose you can use md5 function.

md5 is an on way encryption algo, Before storing data into database encrypt it using md5, and at the time of login validate it.


这篇关于如何保护页面以要求登录以访问它们的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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