See code below.. The php-script writes to a file called guestbook.txt, but the NEW entries comes to the END of the file! I want the new entries to come first. Anyone know how?
--------------
<?php
/* Schtølle Productions 20©02
*/
while(list($key, $val) = each($HTTP_POST_VARS)) {
$val = str_replace("<", "<", $val);
$HTTP_POST_VARS[$key] = str_replace(">", ">", $val);
}
$date = date("m. d. Y H:i:s");
if(empty($name)){ echo "Please enter your name"; exit(); }
$logit = "<font style=\"font-family: verdana; font-size: 8pt;\"><p><b>Nick:</b> ".$HTTP_POST_VARS["name"]."<br>".
"<b>Mail:</b> <a href=\"mailto:".$HTTP_POST_VARS["mail"]."\">".$HTTP_POST_VARS["mail"]."</a><br>".
"<b>Website:</b> <a href=\"http://".$HTTP_POST_VARS["url"]."\">".$HTTP_POST_VARS["url"]."</a><br> <b>Date:</b> $date <br>".
"<b>Location:</b> ".$HTTP_POST_VARS["location"]." <br>";
"<b>Comment:</b><br> ".$HTTP_POST_VARS["comment"]." <br><hr> \n";
$fp = fopen ("guestbook.txt", "a+") or die("Error, something is wrong. Use the contact us-form to report. Thank you");
$logit = stripslashes($logit);
fwrite ($fp, $logit);
fclose ($fp);
header("Location: posted.php");
?>


