I need help with this simple news script I made. It works, its all nice and dandy, except the news lists oldest at top to newest at bottem instead of the other way around. I know why it does this but I can't figure out how to fix it. I've tried different things but everything has failed. If anyone can help it would be much appreciated. The code I have right now is:
<form method="post">
<input type="text" name="subject" value="subject"><br>
<textarea rows="10" cols="20" name="content" value="content"></textarea><br>
<input type="submit" name="updatenews" value="update">
</form>
<?php
$news = fopen("news.txt","a");
$date = date("m/d/y @ h:i:s a");
if (!$updatenews) {
echo("please enter your update");
}
elseif ($updatenews) {
fwrite($news,"<b><u>$subject</u></b> - <i>$date</i><br>$content<br><br>");
echo("update successful");
}
?>
I was thinking about storing the news already in news.txt into a variable and then reposting it after I posted the latest update but I can't get that to work.