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:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74: | <?
require ('conf/config-sql.inc.php');
require ('conf/config-functions.inc.php');
$ip = getenv('REMOTE_ADDR');
mysql_connect($hostname_db,$user_db,$pw_db)
or die(mysql_error());
mysql_query("use $db");
switch ($action) {
case "";
$action = "form";
}
if($action == "form")
{?>
<table border="0">
<tr>
<td> <h3><u>Login:</u></h3></td>
</tr>
</table>
<form name="act" action="login.php?action=login" method="post" enctype="multipart/form-data">
<table width="50%" align="center">
<tr>
<td width="209"> <b>Benutzername:</b> </td>
<td width="180"><input name="authuser" type="text" size="30" maxlength="10"></td>
</tr>
<tr>
<td width="209"> <b>Passwort:</b> </td>
<td> <input type="text" name="authpw" size="30" maxlength="10"> </td>
</tr>
</table>
<table border="0" align="center">
<tr>
<td> <p> </p></td>
<td> <input type="submit" name="send" value="Einloggen"> </td>
<td> <input type="reset" name="reset" value="Zurück"> </td>
</tr>
</table>
</form><?
}
if($action == "login")
{
$authuser = $_POST['authuser'];
$authpw = $_POST['authpw'];
$authpw = md5($authpw);
$query = 'SELECT * FROM mitglieder WHERE(nick="'.$authuser.'")';
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
if($row['gesperrt'] == 1)
{fehler_melden("Benutzer gesperrt!");}
else if($row['aktivierung'] != 1)
{fehler_melden("Zugang noch nicht freigeschalten!");}
else if($row['pass'] == $authpw)
{
session_save_path("conf_sess");
session_start();
$_SESSION['id'] = $row['id'];
$_SESSION['nick'] = $row['nick'];
$_SESSION['hp'] = $row['hp'];
$_SESSION['icq'] = $row['icq'];
$_SESSION['geboren'] = $row['geboren'];
$_SESSION['ort'] = $row['ort'];
$_SESSION['registriert'] = $row['registriert'];
$_SESSION['zuletzt'] = $row['zuletzt'];
?><a href="index.php">weiter</a><?
}
else
{fehler_melden("Login nicht korrekt!");}
}
}?> |