Control panel
Webmail


Back

Example: Password protection
There are many ways to protect your website with a password.

Here are a few examples:

PHP: Make a file called password.php containing:
----- Code begin -----
<?php
$user = 'peter';
$password = md5('mypassword');
$besked = 'Password protected area';

if(!($PHP_AUTH_USER == $user && $PHP_AUTH_PW == $password){
Header('WWW-Authenticate: Basic realm="'.$besked.'"');
Header("HTTP/1.0 401 Unauthorized");
echo "Unauthorized</h1>";
exit;
}
?>
----- Code end -----


On webpages, you want to be password protected include this line:

----- Code begin -----
<?php require_once('password.php'); ?>
----- Code end -----


Note: We do not offer programming- or webdesign-support for your hostingaccount.