Okay i got a questbook code here, but the problem is that the new messages aren't displayed first... they come under in the page, how do I have to change the code to have the new messages displayed first?
Thanx greetz savale
<head>
<title>berichten</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#063A68" text="#FFFFFF" link="#AAAAAA" vlink="#AAAAAA">
<?php
// If the url includes ?view then the guestbook will be viewed
if ($QUERY_STRING == "view") {
readfile("gbook.dat");
echo <<<END
<p align="center"><font face="Arial" size=+0><a href="$PHP_SELF"><font color="#EE9516">Post een bericht</font></a></p>
<p align="center"><font face="Arial" size=-1>© <a href="http://www.savale.com">www.savale.com</a> 2001. All rights reserved.</font></p>
END;
exit();
}
// Prepare timestamp
$h= (date("H") +1);
$dtstamp = date ("d M Y $h:i:s", time()+3600);
// Test to see if the message box contains something
if ($inhoud) {
// BUG FIX: Take any "'" items out of the data..
$inhoud = StripSlashes($inhoud);
$inhoud = nl2br($inhoud);
// Test to see if the email address is blank. If so then substitute a temp one
if (!$email) {
$email="onbekend";
}
// Assign the lines html for each guestbook entry to a variable
$code = <<<ENDBLOCK
<!-- start of entry -->
<!-- HOST: $REMOTE_HOST IP: $REMOTE_ADDR -->
<center>
<table border=1 cellpadding=3 cellspacing=0 width=550 bordercolor="#FFFFFF">
<tr>
<td width=250><font face="arial" size=+0 color="#EE9516"><b>Naam: </b></font><font face="arial" size=+0>$naam</font></td>
<td><font face="arial" size=+0 color="#EE9516"><b>Onderwerp: </b></font><font face="arial" size=+0>$onderw</font></td>
</tr>
<tr>
<td colspan=2 height=50><font face="arial" size=+0>$inhoud</font></td>
</tr>
<tr>
<td><font face="arial" size=-1 color="#EE9516"><b>Gepost op: </b></font><font face="arial" size=-1>$dtstamp</font></td>
<td><a href="$homepage" target="_new"><img src="homepage.gif" border=0 align=right></a><a href="mailto:$email"><img src="email.gif" border=0 align=right></a></td>
</tr>
</table>
</center>
<p>
<!-- end of entry -->
ENDBLOCK;
// Open the guestbook datafile and append the code to it
$fp = fopen("gbook.dat","a");
fwrite($fp,$code);
fclose($fp);
// Thank the user
echo <<<ENDTHANKS
<p align="center"><font face="Arial" size=+0>Bedankt voor het posten van je bericht! Klik <a href="$PHP_SELF?view">hier</a> om de berichten te bekijken</font></p>
ENDTHANKS;
} else {
// If the message field is empty or non-existant, display the Sign Book form
echo <<<END
<p align="center"><font face="Arial" size=+0>Vul hier uw bericht in of klik <a href="$PHP_SELF?view">hier</a> om terug te gaan naar de berichten.</font></p>
<form method="post">
<table width="400" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><font face="arial" size=-1 color="#EE9516"><b>Je naam:</b></font></td>
<td><input style="background-color:white" style="border:0" type="text" name="naam" maxsize=25 size=25></td>
</tr>
<tr>
<td><font face="arial" size=-1 color="#EE9516"><b>Het onderwerp:</b></font></td>
<td><input style="background-color:white" style="border:0" type="text" name="onderw" size="25" maxlength="25"></td>
</tr>
<tr>
<td><font face="arial" size=-1 color="#EE9516"><b>Je e-mailadres:</b></font></td>
<td><input style="background-color:white" style="border:0" type="text" name="email" size ="25"></td>
</tr>
<tr>
<td><font face="arial" size=-1 color="#EE9516"><b>Je homepage:</b></font></td>
<td><input style="background-color:white" style="border:0" type="text" name="homepage" size="25"></td>
</tr>
</table>
<p>
<table width="400" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td colspan=2><textarea style="background-color:white" style="border:0" name="inhoud" rows="5" cols="45"></textarea></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Posten"></td>
<td><input type="reset" name="Submit2" value="Legen"></td>
</tr>
</table>
</form>
<p> </p>
END;
}
echo <<<END
END;
?>
<p align="center"><font face="Arial" size=-1>© <a href="http://www.savale.com">www.savale.com</a> 2001. All rights reserved.</font></p>
</body>