Enforcing Basic authentication : Authentication « HTML « PHP
- PHP
- HTML
- Authentication
Enforcing Basic authentication
<?php
header('WWW-Authenticate: Basic realm="My Website"');
header('HTTP/1.0 401 Unauthorized');
echo "You need to enter a valid username and password.";
exit();
?>
Related examples in the same category