das: Problem mit LogIn-Formular

Beitrag lesen

hallo,
habe ein LogIn-Formular, dass in den Adminbereich weitergeht...

Auf der Startseite gibt es einen Button (Admin), der zum LogIn führt.
Nachdem ich mich richtig eingeloggt habe, erscheint aber immer ein leeres Fenster...
Der LogIn hat jedoch funktioniert! (wenn ich erneut auf der Startseite auf den Admin-Link klicke komme ich ins Backend und bin als Admin angemeldet.

ich hoffe Ihr könnte mir weiterhelfen, danke schon mal!
und hier der php code:

  
<?php  
  
$error_msg = "";  
if ($_POST['username']) {  
  
	$username = $_POST['username'];  
	$password = $_POST['password'];  
	// Simple hard coded values for the correct username and password  
	$admin = "theterminator";  
    $adminpass = "goobernuts";  
    // connect to mysql here if you store admin username and password in your database  
    // This would be the prefered method of storing the values instead of hard coding them here into the script  
    if (($username != $admin) || ($password != $adminpass)) {  
		$error_msg = ': <font color="#FF0000">Your login information is incorrect</font>';  
	} else {  
		session_start();  
        $_SESSION['admin'] = "theterminator";  
		require_once "index.php";  
		exit();  
	}  
  
}// close if post username  
?>  
<html>  
<head>  
<style type="text/css">  
<!--  
body {  
	font-family: Verdana, Geneva, sans-serif;  
	margin-left: 0px;  
	margin-top: 0px;  
	margin-right: 0px;  
}  
-->  
</style></head>  
<body>  
  
<?php  
if ($_SESSION['admin'] != "theterminator") {  
    echo '<h3>Only the administrator can view this directory</h3><br />  
   	  
	<table width="340" border="0">  
<form action="admin_check.php" method="post" target="_self">  
  <tr>  
    <td colspan="2">Please Log In Here' . $error_msg . '</td>  
  </tr>  
  <tr>  
    <td width="96">Username:</td>  
    <td width="234"><input type="text" name="username" id="username" style="width:98%" /></td>  
  </tr>  
  <tr>  
    <td>Password:</td>  
    <td><input type="password" name="password" id="password" style="width:98%" /></td>  
  </tr>  
  <tr>  
    <td colspan="2" align="center"><input type="submit" name="button" id="button" value="Log In Now" /></td>  
  </tr>  
</form>  
</table>  
	<br />  
<br />  
<br />  
  
<a href="../">Or click here to head back to the homepage</a>';  
exit();  
}  
?>  
</body>  
</html>  

...der code ist übrigens aus einem tutorial