Home  >  Article  >  Backend Development  >  [PHP] Open the browser password input dialog box

[PHP] Open the browser password input dialog box

WBOY
WBOYOriginal
2016-07-25 09:11:321498browse
  1. if (($_SERVER['PHP_AUTH_USER'] != 'specialuser') || ($_SERVER['PHP_AUTH_PW'] != 'secretpassword')) {
  2. header('WWW-Authenticate: Basic Realm="Secret Stash"');
  3. header('HTTP/1.0 401 Unauthorized');
  4. print('You must provide the proper credentials!');
  5. exit;
  6. }
  7. ?>
复制代码


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn