I would to set it up where if someone sends in a request \"logout\" it will automatically take them to a page saying \"successful log out\". If the customer tries to press t
You can use the meta tag http-equiv="refresh"
with a very short response time (e.g. content="1"
). This refresh will clear any $_POST
.
if ( !isset($_SERVER['PHP_AUTH_USER']) || $_SERVER['PHP_AUTH_USER']!='myusername' || $_SERVER['PHP_AUTH_PW']!='mypassword' || isset($_POST['logout']) ) {
header('WWW-Authenticate: Basic realm="My protected area"');
header('HTTP/1.0 401 Unauthorized');
echo '401 Unauthorized 401 Unauthorized
You are not allowed to see this page. Reload the page to try again.
';
exit();
}