Created
March 4, 2019 09:52
-
-
Save Kcko/c0a0041509dca64be0486893d8c45e34 to your computer and use it in GitHub Desktop.
PHP Auth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (empty($_SERVER['PHP_AUTH_USER']) || | |
$_SERVER['PHP_AUTH_USER'] != "login" || | |
$_SERVER['PHP_AUTH_PW'] != "pass") { | |
header('WWW-Authenticate: Basic realm="My Realm"'); | |
header('HTTP/1.0 401 Unauthorized'); | |
echo 'Zde nemáte přístup bez jména a hesla'; | |
exit; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment