visionsign
Mitglied
An welcher stelle muss ich was machen, um html im diesen Gästebuch zu verbieten?
hier die function zum reinschreiben
Code:
<p><a href="index.php?site=insertgb">In das Gästebuch Eintragen</a>
<br />
<br />
<?php
include 'include/config.inc.php';
?>
<?
$resid = mysql_query ("SELECT * FROM guestbook ORDER BY id DESC");
while ($record = mysql_fetch_array ($resid, MYSQL_ASSOC))
{
$ID ="$record[ID]"."";
$name ="$record[name]"."";
$email ="$record[email]"."";
$www ="$record[www]"."";
$herkunft ="$record[herkunft]"."<br>\n";
$datum ="$record[datum]"."<br>\n";
$content ="$record[content]"."";
$content = nl2br($content);
echo "
<table width=\"580 px\" border=\"0\" align=\"center\" cellpadding=\"2\" cellspacing=\"2\">
<tr>
<td width=\"30 px\">Nick: $name</td>
<td rowspan=\"4\" width=\"330 px\" valign=\"top\">$content</td>
</tr>
<tr>
<td valign=\"top\" width=\"30 px\">
<a href=\"mailto:$email\"><img src=\"images/email.gif\" width=\"16\" height=\"16\" border=\"0\"></a></td>
</tr>
<tr>
<td width=\"30 px\">
<a href=\"$www\" target=\"blank\"><img src=\"images/home.gif\" width=\"16\" height=\"16\" border=\"0\">
</tr>
<tr>
<td width=\"30 px\">aus: $herkunft</td>
</tr>
<tr>
<td width=\"30 px\">Eintrag Nummer: $ID</td>
</tr>
</table>
<br>" ;
}
?>
hier die function zum reinschreiben
Code:
<?php
include ("include/config.inc.php");
if ($_POST["submit"] == "eintragen") {
$name = $_POST["name"];
$email = $_POST["email"];
$www = $_POST["www"];
$herkunft = $_POST["herkunft"];
$content = $_POST["content"];
if (mysql_query ("INSERT INTO guestbook (name, email, www, herkunft, content) VALUES ('$name', '$email', '$www', '$herkunft', '$content')")) {
echo "Daten wurden eingefügt";
} else {
echo "Fehler beim einfügen der Daten";
}
} else {
?>
<div align=center>
<form action="" method="post">
<table width="200" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td>Name:</td>
<td><input type="text" name="name"></td>
</tr>
<tr>
<td>EMail:</td>
<td><input type="text" name="email"></td>
</tr>
<tr>
<td>WWW:</td>
<td><input type="text" name="www"></td>
</tr>
<tr>
<td>Herkunft:</td>
<td><input type="text" name="herkunft"></td>
</tr>
<tr>
<td valign="top">Message:</td>
<td><textarea name="content" cols="20" rows="5"></textarea></td>
</tr>
</table>
<input type="submit" name="submit" value="eintragen"></input>
<input type="reset" name="reset" value="löschen"></input>
</form>
</div>
<?php
}
?>