Inloggen zonder database

Youtube tutorial login met MySQL
Tutorial login met MySQL
Tutorial 2 login met MySQL
OOP Login systeem met PHP en MySQL

Gebruikersnaam
Wachtwoord
<h1>Inloggen zonder database</h1>
<a href="https://www.youtube.com/watch?v=nPJ4jcXH3TM">Youtube tutorial login met MySQL </a></br>
<a href="http://www.wikihow.com/Create-a-Secure-Login-Script-in-PHP-and-MySQL">Tutorial login met MySQL</a></br>
<a href="http://www.phpeasystep.com/phptu/6.html">Tutorial 2 login met MySQL</a></br>
<a href="https://www.youtube.com/watch?v=c_hNNAdyfQk">OOP Login systeem met PHP en MySQL</a></br></br>
<?
/* 
// voorbeeld sessie controleren voor de beveiligde pagina.

if(isset($_SESSION['wachtwoord'])){
    echo '<meta http-equiv="refresh" content="0; url=login.php"> ';
}
*/
  
// Start loginscript zonder database....

if(isset($_POST['submit']))
{
    
loginaction();
    
// Hier komt de code als de gebruiker is ingelogd.
    
echo "De gebruiker is ingelogd....";
    
?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html lang='en'>
    <head>
    <meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'>
    <!-- the next meta tag does the redirect -->
    <meta http-equiv="refresh" content="3;url=http://www.albeda.nl">
    <title>Login</title>
    </head>
    <body>
    <p>U bent ingelogd.....</p>
     </body>
    </html>
    <?

    
}
else
{
        
sessioncheck();
}

function 
loginaction()
{
    
$gebruikers = array();
    
// hier geef je de gebruikersnamen en het wachtwoord op......
    
$gebruikers['gebruiker1'] = 'wachtwoord1';
    
//$gebruikers['gebruiker2'] = 'wachtwoord2';
    
    
if(array_key_exists($_POST['gebruiker'], $gebruikers))
    {
        if(
$_POST['wachtwoord'] == $gebruikers[$_POST['gebruiker']])
        {
            
$_SESSION['login']['gebruiker'] = sha1(md5($_POST['gebruiker']));
            
$_SESSION['login']['wachtwoord'] = sha1(md5($_POST['wachtwoord']));
        }
        else
        {
            
showform();
            exit();
        }
    }
    else
    {
        
showform();
        exit();
        
    }
}

function 
sessioncheck()
{
    if(!isset(
$_SESSION['login']['gebruiker']) || !isset($_SESSION['login']['wachtwoord']))
    {
        
showform();
        exit();
    }
}

function 
showform()
{
?>
        <form id="form1" name="form1" method="post" action="<?=$_SERVER['PHP_SELF'];?>">
        Gebruikersnaam 
        <input type="text" name="gebruiker" id="gebruiker" />
        <br />
        Wachtwoord
        <input type="text" name="wachtwoord" id="wachtwoord" />
        <br />
        <input type="submit" name="submit" id="submit" value="Inloggen" />
        </form>
<?php
 show_source
(__FILE__);  
}


?>