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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|
<?php
error_reporting(0);
$titel = 'Registrieren';
$styles = '<link href="/sf/m/boxes/boxes.css" rel="stylesheet" type="text/css"><link href="/sf/f/registration/registration.css" rel="stylesheet" type="text/css"><link href="/sf/m/buttons/buttons.css" rel="stylesheet" type="text/css"><link href="/sf/f/index/index.css" rel="stylesheet" type="text/css">';
$inhalt = '
<div class="blog">
</div>
<div id="kmain" role="main">
<div class="noh1"></div>
<div style="margin-top:16px;">
<div class="box appletbox large">
<div class="hd">
<div class="tl"></div>
<div class="tr"></div>
<div class="tm"></div>
<div class="m">
<div class="mi">
<div class="h h2">
<div class="hbegin"></div>
<h2>Chat Login</h2><div class="img boxHdImg under18 catimg" style="background: transparent url("/sf/f/index/cats/cat_2hd.png") no-repeat top left; *background-image: none; *filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="/sf/f/index/cats/cat_2hd.png", sizingMethod="crop", enabled=true); height: 90px; width: 120px; bottom: -13px;" ></div>
</div>
</div>
</div>
</div>
<div class="bd fade bd-fade">
<div class="m">
<div class="mi"><p class="justified">
<form action="registration.php" method="POST" accept-charset="UTF-8"
enctype="application/x-www-form-urlencoded"
id="form-reg"
name="form-reg">
<div class="formerror hidden" id="err-reg-chatServer">
</div>
<table class="none">
<tbody>
<tr id="formline-reg-nick" class="formline formline-reg-nick formres-no formres-noresult-reg-nick ">
<td class="formlabel">
<?php
error_reporting(0); // Die nervigen Warnings ausblenden
mysql_select_db("bananachat", mysql_connect("localhost", "root", "")); // Datenbankverbindung, bitte anpassen!
if(!$_POST[submit]) {
echo <form method="POST" action="registration.php">
<tr>
<td width="100">Nickname:</td>
<td><input type="text" name="nickname"></td>
</tr>
<tr>
<td>Passwort:</td>
<td><input type="password" name="password"></td>
</tr>
<tr>
<td width="100">Real Name:</td>
<td><input type="text" name="realname"></td>
</tr>
<tr><td>Geschlecht:</td>
<td><select name="gender">
<option value="0">- Auswählen -</option>
<option value="1">männlich</option>
<option value="2">weiblich</option>
</select>
</td>
</tr>
<tr>
<td width="100">Stadt:</td>
<td><input type="text" name="stadt"></td>
</tr>
<tr>
<td width="100">Land:</td>
<td><input type="text" name="land"></td>
</tr>
<tr>
<td width="100">Job:</td>
<td><input type="text" name="job"></td>
</tr>
<tr>
<td width="100">Hobbys:</td>
<td><input type="text" name="hobbys"></td>
</tr>
<tr>
<td width="100">Motto:</td>
<td><input type="text" name="motto"></td>
</tr>
<tr>
<td> </td>
<td><br><input type="submit" name="submit" value="Registrieren"></td>
</tr>
</table>
</form>';
else {
$nick = mysql_real_escape_string($_POST[nickname]);
$pw = mysql_real_escape_string($_POST[password]);
$gender = mysql_real_escape_string($_POST[gender]);
$stadt = mysql_real_escape_string($_POST[stadt]);
$realname = mysql_real_escape_string($_POST[realname]);
$land = mysql_real_escape_string($_POST[land]);
$hobbys = mysql_real_escape_string($_POST[hobbys]);
$job = mysql_real_escape_string($_POST[job]);
$motto = mysql_real_escape_string($_POST[motto]);
$row = mysql_fetch_array(mysql_query("SELECT `name` FROM `accounts` WHERE `name` = '".$nick."'"));
if(!$nick) {
$errors .= '<br>- Du hast kein Nick angegeben.';
} else if($row[name] != '') {
$errors .= '<br>- Der Nick '.$nick.' ist bereits vergeben.';
} else if(strlen($nick) > 25) {
$errors .= '<br>- Dein Nick ist zu lang.';
}
if(!$pw) {
$errors .= '<br>- Du hast kein Passwort angegeben.';
} else if(strlen($pw) > 12) {
$errors .= '<br>- Dein Passwort ist zu lang.';
}
if(!$errors) {
echo 'Dein Nick <b>'.$nick.' wurde erfolgreich registriert</b>!<br><br><input type="button" value="Zum Login" onClick="location.href=\'login.php\'">';
mysql_query("INSERT INTO `accounts` SET `name` = '".$nick."', `password` = '".sha1($pw)."', `stadt` = '".$stadt."', `land` = '".$land."', `hobbys` = '".$hobbys."', `job` = '".$job."', `motto` = '".$motto."', `realname` = '".$realname."', `gender` = '".$gender."'");
} else {
echo 'Es sind folgende <b>Fehler aufgetreten</b>:<br><b><font color="red">'.$errors.'</font></b><br><br><input type="button" value="Zurück zur Registration" onClick="location.href=\'registration.php\'">';
}
}
?>
</p>
</div>
</div>
<div class="bl"></div>
<div class="br"></div>
<div class="bm"></div>
</div>
</div>
</div></div>
</div>
';
echo str_replace(array('<?inhalt?>', '<?titel?>', '<?styles?>'),array($inhalt, $titel, $styles),implode("",file("sf/b/style.tpl")));
?>
|