[PHP] Open the browser password input dialog box

WBOY
Release: 2016-07-25 09:11:32
Original
1529 people have browsed it
  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. ?>
复制代码


source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template