<?
include ( '../inc/settings.php' );

if ( isset ( $_POST['username'] ) ) {

$user=escape ( $_POST['username'] );

$pass=escape ( $_POST['password'] );

mysql_select_db ( 'account' );

$query=mysql_query ( "SELECT * FROM `account` WHERE `login` = '$user' AND `password` = password('$pass');" );

if ( mysql_num_rows ( $query ) ) {

session_start();
$_SESSION['login']=TRUE;
$_SESSION['user']=$user;

header('location: download.php');

} else {

$msg="Nicht angemeldet!";

}
}
?>
<html>
<head>
<title>Login</title>
</head>
<body>
<center>
<p><?=$msg?><br> 
Um fortzufahren, Bitte Login <br>
<u>Achtung: Da es sich um eine Privat Aktion handelt, gibt es kein Recht auf Umtausch!</u>
<form action='' method='post'>
<label for='username'>Username:<input name='username'/></label><br><br>
<label for='password'>Password:<input type='password' name='password'/></label><br><br>
<input type='submit' value='Login!'/>
</form>
</body>
</html>