开发者

How to use HTTP Authentication with PHP and then run the entered data against a database?

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 开发者_JAVA技巧are checked against a mysql database?

I am sure this is possible, but i have no idea how :/


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.

Here's an article about that, for instance : HTTP Basic and Digest authentication with PHP

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜