PDA

View Full Version : Ok, so i've made a php news system for my site...(more)


Silver Sun
10-15-2002, 08:41 PM
But, when i post, what i have posted goes to the bottom of the page. Is there a way for me to get it to either replace what is already there or appear at the top?

thanks in advance :thumbsup:

Nightfire
10-15-2002, 08:50 PM
You using a database or flat files?

Silver Sun
10-15-2002, 08:57 PM
I'm opening a text file to use

mordred
10-15-2002, 09:56 PM
And where's your code?

(please don't post everything, just the relevant parts)

Silver Sun
10-15-2002, 10:09 PM
<?php
$file="bulletin.txt";
$fp=fopen("$file", "a+");

$write=stripslashes("<font size='2'><b><small>$first </b></small>$who <br> <b><small>$second</b></small> $to <br><b><small> $third </b></small>$comment <br></br></font>");
fwrite($fp, "$write");
fclose($fp);
include ("bulletin.txt");

?>

SYP}{ER
10-18-2002, 12:29 AM
You want
$fp=fopen("$file", "r+");

Not a+ as a+ puts the pointer at the END of the file. r+ puts it at the top :)