创建简单的PHP登录脚本很容易,用简单的一个表MySQL的集成。我想知道我怎么能对你相当时髦的HTTP认证是在HT Access和PHP可用,但用户核对MySQL数据库?
Creating simple php login scripts is easy, with simple one table mysql integration. I was wondering how i could you the rather snazzy HTTP Authentication that is available in HT Access and PHP, but the users are checked against a mysql database?
我相信这是可能的,但我不知道如何:/
I am sure this is possible, but i have no idea how :/
认证数据的(至少如果使用基本模式)的应该是 $可用_ SERVER ['PHP_AUTH_USER ']
和 $ _ SERVER ['PHP_AUTH_PW']
的(见的 $ _ SERVER
)的 - 这意味着你只是要使用这些检查你的数据库。
The authentication data (at least if using Basic mode) should be available in $_SERVER['PHP_AUTH_USER']
and $_SERVER['PHP_AUTH_PW']
(see $_SERVER
) -- which means you "just" have to use those to check with your database.
下面是有关的文章,例如: HTTP与PHP基本和数字认证
Here's an article about that, for instance : HTTP Basic and Digest authentication with PHP