Hardcoding the username and password into a script : Authentication « HTML « PHP
- PHP
- HTML
- Authentication
Hardcoding the username and password into a script
<?
if ( (! isset ($PHP_AUTH_USER)) || (! isset ($PHP_AUTH_PW)) ||
($PHP_AUTH_USER != 'secret') || ($PHP_AUTH_PW != '') ) :
header('WWW-Authenticate: Basic realm="Secret Family"');
header('HTTP/1.0 401 Unauthorized');
print "Authorization is required.";
exit;
endif;
?>
Related examples in the same category