PHP User authentification


/ Published in: PHP
Save to your folder(s)

user authentification


Copy this code and paste it in your HTML
  1. <?php
  2. if (!isset($_SERVER['PHP_AUTH_USER']) || !($_SERVER['PHP_AUTH_USER'] == 'xxx' && $_SERVER['PHP_AUTH_PW'] == 'xxx')) {
  3. header('WWW-Authenticate: Basic realm="DBU Manager"');
  4. header('HTTP/1.0 401 Unauthorized');
  5. echo 'Access denied';
  6. exit();
  7. }
  8. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.