开发者

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

开发者 https://www.devze.com 2022-12-15 15:19 出处:网络
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 th

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

精彩评论

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