How to use base HTTP Authentication in php
This article will explain in detail how to use base HTTP verification in php. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
The details are as follows:
Function http_auth ($un, $pw, $realm= "Secured Area") {if (! (isset ($_ SERVER ['PHP_AUTH_USER']) & & isset ($_ SERVER [' PHP_AUTH_PW']) & & $_ SERVER ['PHP_AUTH_USER'] = = $un & & $_ SERVER [' PHP_AUTH_PW'] = = $pw)) {header ('WWW-Authenticate: Basic realm= "$realm'); header ('Status: 401Unauthorized'); exit () }} this is the end of the article on "how to use base HTTP Verification in php". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.