<?
error_reporting(E_ALL);
require("config.php");
@session_start();
if($_COOKIE["adminin"] == "Yes" || $_SESSION["adminin"] == "Yes"){
@header('Location: ./index.php?table=Leden_A');
exit();
}
if($_POST["Submit"]){
if($_POST["username"] == $gebruikersnaam && $_POST["password"] == $wachtwoord){
setcookie ("adminin", "Yes",time()+3600);
$_SESSION["adminin"] = "Yes";
if($_SERVER["HTTP_REFERRER"] != NULL){
header("Location: " . $_SERVER["HTTP_REFERRER"]);
exit();
}
else {
header("Location: ./index.php?table=Leden_A");
exit();
}
}
else {
$error = "Wachtwoord of Gebruikersnaam onjuist, probeer opnieuw!";
}
}
?>
<html>
<head>
<title>Admin Login</title>
</head>
<body>
<form action="<? echo $_SERVER["PHP_SELF"];?>" method="POST" name="adminlogin" id="adminlogin">
<table width="250" border="1" bordercolor="#000000" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#000000">
<td colspan="2"><div align="center"><font color="#FFFFFF"><strong>Aanmelden:</strong></font></div></td>
</tr>
<tr>
<td width="45%"><font face="Times New Roman, Times, serif"><strong>Gebruikersnaam:</strong></font></td>
<td width="55%"><input name="username" type="text" class="input" id="username" size="25"></td>
</tr>
<tr>
<td><font face="Times New Roman, Times, serif"><strong>Wachtwoord:</strong></font></td>
<td><input name="password" type="password" id="password" size="25"></td>
</tr>
<tr>
<td colspan="2"><div align="right"><font face="Times New Roman, Times, serif"><strong><input name="Submit" type="submit" id="Submit" value="Aanmelden"></strong></font> </div></td>
</tr>
</table>
<table width="250" border="0">
<tr>
<td><div align="center"><strong><font color="#FF0000"><? echo $error; ?></font></strong></div></td>
</tr>
</table>
</form>
</html>
</body>