fwrite Add to top?
Posted: Fri Dec 06, 2002 2:06 pm
I'm using this code & a form to post text to a php file.
I was wondering weather I would be able to write the infomation that I want to post at the start of the file instead on the end of the file..?
I'm using the script above to make my own sort of shoutbox the only problem being is that the last post is always at the bottom.. Is there any way around this with out using. mysq.
Thanks Darkside
Code: Select all
<?php $post_data = "posts.php";
$data = fopen($post_data, "a");
$post = stripslashes($post);
$by = stripslashes($by);
fwrite($data, "$post <br><b>Posted by:</b> $by<hr>");
fclose($data);
Header ("Location: index.php?folder=flash&page=wof");
?>I'm using the script above to make my own sort of shoutbox the only problem being is that the last post is always at the bottom.. Is there any way around this with out using. mysq.
Thanks Darkside