Nieuw lid |
|
Jah, m'n shoutbox staat nog maar online en ik heb al last van spammers.
Hoe kan ik het best in deze shoutbox hieronderaan ?
<?php
// shout.php
include ("shout_config.php");
if($_SERVER['REQUEST_METHOD'] == 'POST') {
$IP = $_SERVER['REMOTE_ADDR'];
$Naam = mysql_real_escape_string(strip_tags($_POST['Naam']));
$Bericht = mysql_real_escape_string(strip_tags($_POST['Bericht']));
if(empty($Naam)) {
echo "<font face='verdana' size='1' color='#ffffff'><center><b>Je hebt geen naam ingevuld!<br></b></center><p></font>";
}
else
if(empty($Bericht)) {
echo "<font face='verdana' size='1' color='#ffffff'><center><b>Je hebt geen bericht ingevuld!<br></b></center><p></font>";
}
else if(strlen($Bericht) > 100) {
echo "<font face='verdana' size='1' color='#ffffff'><center><b>Je bericht bevat teveel tekens!<br></b></center><p></font>"; }
else {
$Insert = " INSERT INTO `shout` (IP, Naam, Bericht)
VALUES ('".$IP."', '".$Naam."', '".$Bericht."')";
mysql_query($Insert) or die(mysql_error());
}
}
$Select = "SELECT * FROM `shout` order by id DESC LIMIT 5";
$Query = mysql_query($Select) or die(mysql_error());
while ($rij = mysql_fetch_array($Query)) {
echo "<div style='overflow: hidden; position: relative; left: 10px; margin-right: 10px;'><font face='verdana' size='1' color='#ffffff'><div align='left'><b>".$rij['Naam'].":</b></div></font></div><div style='overflow: hidden; position: relative; left: 10px; margin-right: 10px;'><font face='verdana' size='1' color='#ffffff'><div align='left'>".$rij['Bericht']."<hr align='left' width='180'></div></font></div><br> \n";
}
echo '<div align="center">
<form method="POST">
<font face="verdana" size="1" color="#ffffff">
<font face="Verdana" size="1"><b>Naam:</b></font><br>
<input size="15" maxlength="20" type="text" name="Naam" />
<br><br>
<font face="Verdana" size="1" color="#ffffff"><b>Bericht:</b></font><br>
<textarea maxlength="30" type="text" name="Bericht" style="height: 50px; width: 120px;"></textarea>
<br><br>
<input type="submit" name="Toevoegen" value="Plaats bericht!" />
</font>
</form>
</div>';
?>
<?php // shout.php include ("shout_config.php"); if($_SERVER['REQUEST_METHOD'] == 'POST') { $IP = $_SERVER['REMOTE_ADDR']; echo "<font face='verdana' size='1' color='#ffffff'><center><b>Je hebt geen naam ingevuld!<br></b></center><p></font>"; } else echo "<font face='verdana' size='1' color='#ffffff'><center><b>Je hebt geen bericht ingevuld!<br></b></center><p></font>"; } else if(strlen($Bericht) > 100) { echo "<font face='verdana' size='1' color='#ffffff'><center><b>Je bericht bevat teveel tekens!<br></b></center><p></font>"; } else { $Insert = " INSERT INTO `shout` (IP, Naam, Bericht) VALUES ('".$IP."', '".$Naam."', '".$Bericht."')"; } } $Select = "SELECT * FROM `shout` order by id DESC LIMIT 5"; echo "<div style='overflow: hidden; position: relative; left: 10px; margin-right: 10px;'><font face='verdana' size='1' color='#ffffff'><div align='left'><b>".$rij['Naam'].":</b></div></font></div><div style='overflow: hidden; position: relative; left: 10px; margin-right: 10px;'><font face='verdana' size='1' color='#ffffff'><div align='left'>".$rij['Bericht']."<hr align='left' width='180'></div></font></div><br> \n"; } echo '<div align="center"> <form method="POST"> <font face="verdana" size="1" color="#ffffff"> <font face="Verdana" size="1"><b>Naam:</b></font><br> <input size="15" maxlength="20" type="text" name="Naam" /> <br><br> <font face="Verdana" size="1" color="#ffffff"><b>Bericht:</b></font><br> <textarea maxlength="30" type="text" name="Bericht" style="height: 50px; width: 120px;"></textarea> <br><br> <input type="submit" name="Toevoegen" value="Plaats bericht!" /> </font> </form> </div>'; ?>
|