Mega Code Archive

 
Categories / Php / Data Type
 

Checking PHPs global authentication variables

<? if ( (! isset ($PHP_AUTH_USER)) || (! isset ($PHP_AUTH_PW)) ):       header('WWW-Authenticate: Basic realm="Secret Family"');      header('HTTP/1.0 401 Unauthorized');      print "Authorization is required.";      exit; endif; ?>