1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
|
<?php
ob_start(); //Falls es ohne geht diesen Befehl weglassen; ich weiß nicht, was in der header.php drin ist..
session_start();
include("header.php");
include("db.php");
include("functions.inc.php");
if(isset($_REQUEST["submit"])){
if(exist("mitglieder WHERE name = '".strip_tags($_REQUEST["name"])."' AND passwort = '".md5($_REQUEST["passwort"])."'") &&
anzahl("login WHERE ip = '".getenv("REMOTE_ADDR")."' AND erfolgreich = 'nein' AND timestamp > '".(time()-60*30)."'") < 4) {
$eintragen = mysql_query("INSERT INTO login (name, ip, timestamp, erfolgreich) VALUES
('".strip_tags($_REQUEST["name"])."', '".getenv("REMOTE_ADDR")."', '".time()."', 'ja')");
$abfrage = "SELECT id FROM mitglieder WHERE name = '".strip_tags($_REQUEST["name"])."' LIMIT 0,1";
$ergebnis = mysql_query($abfrage);
while($row = mysql_fetch_object($ergebnis)){
$_SESSION["login"] = $row->id; //Loggt ein!
}
header("Location: memberarea.php"); //Weiterleitung im PHP-Stil...
} else {
$eintragen = mysql_query("INSERT INTO login (name, ip, timestamp, erfolgreich) VALUES ('".strip_tags($_REQUEST["name"])."', '".getenv("REMOTE_ADDR")."', '".time()."', 'nein')");
echo "Login schlug fehl";
}
exit(); //Ausgabe stoppen, es wird entweder weitergeleitet oder "Login schlug fehl" gezeigt.
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>login</title>
</head>
<body>
<form action="login.php" method="post">
<table width="90%">
<tbody>
<tr>
<td style="font-family: Century Gothic;" width="50%"><small>
<b>Name:</b>
</small></td>
<td width="50%">
<input name="name" type="text">
</td>
</tr>
<tr>
<td style="font-family: Century Gothic;" width="50%"><small>
<b>Passwort:</b>
</small></td>
<td width="50%">
<input name="passwort" type="password">
</td>
</tr>
<tr>
<td colspan="2" width="100%">
<input value="Login" name="submit" type="submit">
</td>
</tr>
</tbody>
</table>
</form>
<?php
include("footer.php");
?>
</body>
</html> |