<?php
include('ubb.php');
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="mijnstyle.css">
<script language="javascript">
function setCursor()
{
if(document.frmPost.bericht.createTextRange)
{
document.frmPost.bericht.caretPos = document.selection.createRange().duplicate();
}
}
function ubb(begin,eind,opmaak)
{
if(!eind && !opmaak)
{
if(document.frmPost.bericht.createTextRange && document.frmPost.bericht.caretPos)
{
document.frmPost.bericht.caretPos.text = begin;
}
}
else if(opmaak == "dubbel")
{
var selectie = document.selection.createRange().text;
if(!selectie)
{
var url_deel = prompt("Typ hier de/het "+ begin +" die/dat geplaatst moet worden:","");
var tekst_deel = prompt("Typ hier de tekst die geplaatst moet worden:","");
if(url_deel && tekst_deel)
{
document.frmPost.bericht.caretPos.text = "["+begin+"="+url_deel+"]" + tekst_deel + "[/"+eind+"]";
}
}
if(selectie)
{
var url_deel = prompt("Typ hier de url die geplaatst moet worden:","");
if(url_deel)
{
document.selection.createRange().text = "["+begin+"="+url_deel+"]" + selectie + "[/"+eind+"]";
}
}
}
else
{
if(opmaak != "geen")
{
var selectie = document.selection.createRange().text;
if(!selectie)
{
var new_inhoud = prompt("Typ hier de tekst in waarrond "+begin+" & "+eind+" geplaatst moet worden:","");
if(new_inhoud)
{
document.frmPost.bericht.caretPos.text = begin + new_inhoud + eind;
}
}
if(selectie)
{
document.selection.createRange().text = begin + selectie + eind;
}
}
}
document.frmPost.bericht.focus();
return;
}
</script>
</head>
<font size=7>Gastenboek</font><br>
<font size=2>
<?
$dbName = "db";
?>
</font>
<form action='' method='post' name=frmPost>
Naam:<br>
<input name="Naam" value="">
<br>
Bericht:<br>
<textarea rows="5" cols="55" name="bericht" onkeyup="setCursor();" onkeydown="setCursor();" onfocus="setCursor();" onclick="setCursor();"></textarea><br>
<br>
<table width="105" border="0" cellpadding="1" cellspacing="0">
<tr>
<td width="5"><img src="Smilies/smile.gif" width="15" height="15" onclick="ubb(':)');"></td>
<td width="5"><img src="Smilies/sad.gif" width="15" height="15" onclick="ubb(':(');"></td>
<td width="5"><img src="Smilies/tongue.gif" width="15" height="15" onclick="ubb(':P');"></td>
<td width="5"><img src="Smilies/wink.gif" width="15" height="15" onclick="ubb(';)');"></td>
<td width="5"><img src="Smilies/bigsmile.gif" width="15" height="15" onclick="ubb(':D');"></td>
<td width="5"><img src="Smilies/confused.gif" width="15" height="15" onclick="ubb(':S');"></td>
<td width="5"><img src="Smilies/cool.gif" width="15" height="15" onclick="ubb('8)');"></td>
<td width="5"><img src="Smilies/cry.gif" width="15" height="15" onclick="ubb(':'(');"></td>
<td width="5"><img src="Smilies/eek.gif" width="15" height="15" onclick="ubb(':|');"></td>
<td width="5"><img src="Smilies/lol.gif" width="15" height="15" onclick="ubb(':lol:');"></td>
<td width="5"><img src="Smilies/mad.gif" width="15" height="15" onclick="ubb(':@');"></td>
<td width="5"><img src="Smilies/redface.gif" width="15" height="15" onclick="ubb(':redface:');"></td>
<td width="5"><img src="Smilies/rolleyes.gif" width="15" height="15" onclick="ubb('8-)');"></td>
<td width="5"><img src="Smilies/evil.gif" width="15" height="15" onclick="ubb(':evil:');"></td>
<td width="5"><img src="Smilies/ohmy.gif" width="15" height="15" onclick="ubb(':o');"></td>
<td width="5"><img src="Smilies/arrow.gif" width="15" height="15" onclick="ubb(':arrow:');"></td>
<td width="5"><img src="Smilies/idee.gif" width="15" height="15" onclick="ubb(':idee:');"></td>
<td width="5"><img src="Smilies/exclaim.gif" width="15" height="15" onclick="ubb(':!:');"></td>
<td width="5"><img src="Smilies/question.gif" width="15" height="15" onclick="ubb(':?:');"></td>
<td width="5"><img src="Smilies/tdown.gif" width="15" height="15" onclick="ubb(':tdown:');"></td>
<td width="5"><img src="Smilies/tup.gif" width="15" height="15" onclick="ubb(':tup:');"></td>
</tr>
</table><br>
<input type=submit name=submit value=Invoeren></form>
<?php
$datum = date("Y-n-d, H:i:s"); $IP = $REMOTE_ADDR;
if($submit == 'Invoeren'){
if (($Naam) AND ($bericht)) {
$query = "INSERT INTO `VerkReacties` (`Naam`, `bericht`, `Datum`, `IP`)
VALUES ('$Naam', '$bericht', '$datum', '$IP');";
echo " <script language=javascript>alert (\"Bedankt voor het invullen van het gastenboek!\");</script> ";
}
else {
echo "Je hebt niet alle velden ingevoerd. <br> Je naam en bericht zijn verplicht!<br><br>";
}
}
?>
<br>
<?php
$sQuery = "SELECT * FROM `VerkReacties` ORDER BY `Datum` DESC";
{ echo 'gegevens opvragen mislukt.'; } else
{
{
echo "<table width=75% border=1 cellpadding=0 cellspacing=0> <tr bordercolor=#000066><th width=15%><strong>".$aRow['Naam']."</strong></th>
<th width=82%><img src=post.gif><font size=-1> Gepost op:</font><strong> ".$aRow['Datum']."</strong></th><tr>
<tr bordercolor=#000066><td width=15%></td>
<td width=82% align=left>".$aRow['bericht']."</td></tr>
</table><br>";
}
}
?>
<br>
<?
echo "Aantal reacties: ".$aantal; ?>
</html>