toevoegen.php
<?php
include ("config.php");
if(isSet($_POST['post'])) {
mysql_query("INSERT INTO berichtenbalk (username, bericht, ip) VALUES ('".$_POST['naam']."','".$_POST['bericht']."','".$ip."')") or die(mysql_error());
echo "Je bericht is succesvol toegevoegd!";
echo "</marquee><br>";
echo "<a href=\"index.php\">Klik hier om terug te gaan!</a>";
} else {
?>
<form action="" method="post" name="berichtenbalk">
<table width="90%" border="1" cellpadding="2" cellspacing="0" bordercolor="#999999" bgcolor="#CCCCCC">
<tr>
<td colspan="3" height="25" background="img/toptabel2.gif">Plaats een bericht</td>
</tr>
<tr>
<td width="263">Naam
<input name="naam" type="text" maxlength="50"></td>
<td width="334">Bericht
<input name="bericht" type="text" maxlength="50"></td>
<td width="83">
<input type="submit" name="post" value="Post bericht"></td>
</tr>
</table>
</form>
<?php
}
?>
Toon Meer
de balk
<?php
include ("config.php");
echo "<marquee width=70% style=\"cursor: default\" onmouseover=\"this.stop()\" onmouseout=\"this.start()\">";
$hoeveel = "10";
$query = mysql_query("SELECT * FROM berichtenbalk ORDER BY id DESC LIMIT ".$hoeveel) or die (mysql_error());
while ($obj = mysql_fetch_object($query)) {
$usernaam = htmlspecialchars($data->username);
$bericht = htmlspecialchars($obj->bericht);
echo "<b>".$username."</b>: ".$bericht." ".$teken; //tonen van de berichten
}
echo "</marquee><br>";
echo "<a href=\"toevoegen.php\">Bericht plaatsen</a>"; //de link om een bericht te plaatsen
?>
Toon Meer
hier fout gezien in 5seconden.|-)
tip
<b> is oud html gebruik <strong> </strong>