记录登录密码保护的目录 [英] Recording logins for password protected directories
问题描述
我有一个文件夹的根目录为 http://somesite.com/folder
我敢与目录密码保护功能,密码保护中的cPanel,我猜使用某种形式的 htacccess
的。因此,它不是保护与在连接到我可以检查对数据库正常登录系统。
I have a folder in the webroot at http://somesite.com/folder
which I'm password protecting with the directory password protection feature in cpanel which I guess uses some form of htacccess
. So it's not protected with a normal login system that's connected to a database that I can check against.
在一个正确的用户名和密码被输入时,用户可以看到该文件夹的内容
Once a correct username and password is entered, a user can see the content of the folder
http://somesite.com/folder/index.php
我试图找到一个PHP的方式,看看有什么帐户用于登录到该文件夹。任何人都可以想办法可以做到这一点?
I'm trying to find a php way to see what account was used to log into the folder. Anyone can think of a way this can be done?
推荐答案
有关基本的,身份验证,你就会有 $ _ SERVER ['PHP_AUTH_USER']
和 $ _ SERVER ['PHP_AUTH_PW']
。
For basic, authentication, you'll have $_SERVER['PHP_AUTH_USER']
and $_SERVER['PHP_AUTH_PW']
.
有关摘要,您可以解析 $ _ SERVER ['PHP_AUTH_DIGEST']
或只是看看 $ _ SERVER ['PHP_AUTH_USER']
如果你想要的用户名(密码将不会可用)。
For digest, you can parse $_SERVER['PHP_AUTH_DIGEST']
or just look at $_SERVER['PHP_AUTH_USER']
if you want the username (the password won't be available).
这篇关于记录登录密码保护的目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!