如何使用php启用用户身份验证 [英] How to enable user authentication using php

查看:145
本文介绍了如何使用php启用用户身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,例如: -  www.mysite.com 

i希望任何人获取只有在提供用户名和密码后,进入网站。所以我添加了登录页面,注册页面等。我是使用 php和mssql server。我是到网络相关技术。现在我需要帮助,关于如何在主屏幕重定向 有人直接尝试 for 主页。请引导我完成实现相同所需的所有设置和元素。请参阅解释相同的任何教程或网络资料。谢谢jim

解决方案

至少基本上研究这个话题总是好的,之前(而不是?)提出这样的问题:

http://www.php.net/manual/en/features.http- auth.php [ ^ ],

http://www.homeandlearn.co.uk/php/ php14p1.html [ ^ ],

https://github.com/PHPAuth/PHPAuth [ ^ ]。



此外,我不是确定您是否希望拥有自己的基于密码的身份验证,或者希望通过第三方身份对用户进行身份验证,就像使用OpenID一样因此,考虑这种方法,或者更好的是,将它与您自己的身份验证相结合,就像许多网站一样。请参阅:

https://en.wikipedia.org/wiki/OpenID [< a href =https://en.wikipedia.org/wiki/OpenIDtarget =_ blanktitle =New Window> ^ ],

http://openid.net/ [ ^ ],

http://openidexplained.com/ [ ^ ]。



然后你可以使用,例如,< a href =https://github.com/openid/php-openid> https://github.com/openid/php-openid [ ^ ]。



-SA

i have a web site eg :- www.mysite.com

i want anyone to get into the site only after giving username and password. So i added login page, registration page etc. I am using php with mssql server. I am new to web related technologies. Now i need help, on how to redirect from home screen when someone directly tries for the home page. Please guide me through all the settings and elements required to achieve the same. Please refer any tutorial or web material explaining the same. thanks jim

解决方案

It's always good to study the topic at least basically, before (instead?) asking such questions:
http://www.php.net/manual/en/features.http-auth.php[^],
http://www.homeandlearn.co.uk/php/php14p1.html[^],
https://github.com/PHPAuth/PHPAuth[^].

Besides, I'm not sure if you want to have your own password-based authentication, or want to authenticate the user through a third-party identity, as with as with OpenID, so consider this approach, too, or, even better, combine it with your own authentication, like many sites do. Please see:
https://en.wikipedia.org/wiki/OpenID[^],
http://openid.net/[^],
http://openidexplained.com/[^].

Then you can use, for example, https://github.com/openid/php-openid[^].

—SA


这篇关于如何使用php启用用户身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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