Posted By

mortu on 01/16/13


Tagged

user authentification


Versions (?)

PHP User authentification


 / Published in: PHP
 

user authentification

  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  

You need to login to post a comment.