Php uses the baseHTTP verification method. This article describes how to use baseHTTP verification in php. it describes how to use baseHTTP verification in php and how to use predefined SERVER variables $ _ SERVER and header methods, methods that require base HTTP verification in php
This article describes how to use base HTTP verification in php. it involves the usage of predefined SERVER variables $ _ SERVER and header methods. For more information, see
This example describes how to use base HTTP verification in php. Share it with you for your reference. The details are as follows:
?
1 2 3 4 5 6 7 8 9 |
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: 401 unauthorized '); Exit (); } } |
I hope this article will help you with php programming.
Methods of using HTTP verification this article mainly introduces the method of using base HTTP verification in php, involving the usage tips of predefined SERVER variables $ _ SERVER and header methods...