Hi, I have a Add News script on my site. Once the user that logged in submits what he wants to be on the site, it copies all of it into a .txt file.
I use http://www.tripod.lycos.co.uk as my server.
The problem is, when it wrights it into the .txt file, it removes the last thing that was written there. How would I make the text move down so the new text could be the first?
Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Adding</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK REL=STYLESHEET TYPE="text/css" HREF="style.css">
<script src="fade.js" language="Javascript"></script>
</head>
<body bgcolor="#000000" alink="#BBBBBB" link="#BBBBBB" text="#DDDDDD" vlink="#BBBBBB">
<?php
$topic = stripslashes($topic);
$message = stripslashes($message);
$posted = " Posted By: Balrok";
$curr_news = file("news.txt");
$fontshit = "<font color=\"#666666\" size\"=-2\">";
$message = "<b>" . $fontshit . $topic . $posted . "</b><br>\n" . $message . "<p>\n";
foreach($curr_news as $value) {
$message .= $value;
}
$fp = fopen("newsa.txt", "w");
fwrite($fp, $message);
fclose($fp);
echo "Success!";
?>
</body>
</html>
Thanks for your help