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:
|
<?php
$ja = $_POST['ja'];
$dumme = $_POST['dumme'];
$email = $_POST["email"];
$inhalt = $_POST["inhalt"];
$versteckt = $_POST['versteckt'];
$web = $_POST['web'];
$code = $_POST['code'];
if($ja=="ja")
{
if($dumme=="" ){$bitte="background-color:#CC0000;color:#FFFFFF;";}
if($inhalt==""){$bitte2="background-color:#CC0000;color:#FFFFFF;";}
if($code==""){$bitte3="background-color:#CC0000;color:#FFFFFF;";}
}
$rnd1 = rand(0,9);
$rnd2 = rand(0,9);
$rnd3 = rand(0,9);
$rnd4 = rand(0,9);
$sicherheit="$rnd1$rnd2$rnd3$rnd4";
$sicherheit2=$sicherheit-18;
echo"<form style='padding:0px;margin:0px;' action='?section=blub&menu=startseite' Method='post' name='Testform'>
<span class='chap'>Gästebuch</span>
<table border=0 cellpadding=1 cellspacing=1 width='320' align='center'>
<tr>
<td width='50%'><b>Name:</b><br><input value='$dumme' type='text' name='dumme' style='width:90%;$bitte'></td>
<td rowspan='3'><b>Kommentar:</b><br><textarea value='$inhalt' name='inhalt' style='width:100%;height:100;$bitte2'></textarea></td>
</tr>
<tr>
<td><b>eMail:</b><br><input type='text' value='$email' name='email' style='width:90%;'></td>
</tr>
<tr>
<td><b>Homepages:</b><br><input type='text' value='$web' name='web' style='width:90%;'></td>
</tr>
<tr>
<td colspan='2' align='center'>Bitte <b>$sicherheit</b> in das Feld eingeben: <input type='text' name='code' maxlength='4' style='width:40px; $bitte3'>
<input type='hidden' name='ja' value='ja'><input type='hidden' name='versteckt' value='$sicherheit2'>
</td>
</tr>
<tr>
<td colspan='2' align='center'><input type='submit' value='Eintragen'></td>
</tr>
</table>
</form>
<br>";
include("config.inc.php");
$verbindung=mysql_connect($dbhost,$dbuser,$dbpasswd);
$seite = $_GET["seite"];
if($ja==""){
if(!isset($seite))
{
$seite = 1;
}
$eintraege_pro_seite = 4;
$start = $seite * $eintraege_pro_seite - $eintraege_pro_seite;
$abfrage = "SELECT * FROM gb ORDER BY id DESC LIMIT $start, $eintraege_pro_seite";
$ergebnis=mysql_db_query($db,$abfrage,$verbindung);
$zahl = mysql_num_rows($ergebnis);
$i=1;
$zahl2=$zahl-1;
while($row = mysql_fetch_object($ergebnis))
{
$name = $row->name;
$text = $row->inhalt;
$text = htmlentities("$text");
$text = nl2br($text);
include("include/smeilies.php");
include("include/bbcs.php");
$admin = $row->admin;
$admin = nl2br($admin);
if($admin!="")
{$admin2="<br>__________________
<br><span style='font-size:8pt;'>Kommentar: $admin";}else{$admin2="";}
$datum = date("d. M y H:i", $row->datum);
if($row->email == ""){$email = "";}else{$email = " <a href="mailto:$row->email">eMail</a>";}
echo"
<table border=0 cellpadding=5 cellspacing=1 width='400' align='center' style='background-color: $ta_farbe;'>
<tr>
<td><b>$name</b></td>
<td align='right'>$email</td>
</tr>
<tr><td colspan=2><span class='forum'></span></td></tr>
<tr>
<td colspan=2>$text $admin2</td>
</tr>
<tr>
<td colspan=2 align='right'><span style='font-size:7pt;'>$datum</td>
</tr>
</table><br>";
}
echo"
<br><center><span style='font-size:8pt;'>";
$result = mysql_query("SELECT id FROM gb");
$menge = mysql_num_rows($result);
$wieviel_seiten = $menge / $eintraege_pro_seite;
echo "<b>Seite:</b> ";
for($a=0; $a < $wieviel_seiten; $a++)
{$b = $a + 1;
if($seite == $b){echo " <b>$b</b> ";}
else{echo " <a href="?section=blub&menu=startseite&seite=$b">$b</a> ";}
}
}
else
{
$dumme = $_POST['dumme'];
$email = $_POST["email"];
$inhalt = $_POST["inhalt"];
$versteckt = $_POST['versteckt'];
$web = $_POST['web'];
$code = $_POST['code'];
$code2=$code-18;
$datum = time();
if(($dumme=="" OR $inhalt=="" OR $code=="") OR ($code2!="$code"))
{
echo"</table>";
}
else{
$eintrag = "INSERT INTO gb (datum, name, email, web, inhalt) VALUES ('$datum', '$dumme', '$email', '$web', '$inhalt')";
$eintragen = mysql_db_query($db,$eintrag,$verbindung);
if($eintragen == true)
{
echo"<meta http-equiv='refresh' content='0; URL=?section=blub&menu=startseite'>";
}
else
{
echo "Fehler beim Speichern";
}
}}
?> |