Silver Sun
02-02-2003, 03:20 PM
here is the code......
<?php
$filename = " $username $passwrd .txt";
if (file_exists($filename)) {
$file="test.txt";
$fp=fopen("$file", "a+");
$date = date ("d / m / y");
$old = fread ($fp,EOF);
$write =stripslashes("$new $old");
print " $old ";
fputs($fp, "$write");
fclose($fp);
print "Your message has been posted correctly";
include ("test.txt");
} else {
print "Incorrect Username or Password, return to the previous page and try again.";
}
?>
The $old is the stuff that is already inside the txt file. The $new is the stuff sent through by a form.
I need $new to appear on top, with $old appearing below it.
Thanks in advance
<?php
$filename = " $username $passwrd .txt";
if (file_exists($filename)) {
$file="test.txt";
$fp=fopen("$file", "a+");
$date = date ("d / m / y");
$old = fread ($fp,EOF);
$write =stripslashes("$new $old");
print " $old ";
fputs($fp, "$write");
fclose($fp);
print "Your message has been posted correctly";
include ("test.txt");
} else {
print "Incorrect Username or Password, return to the previous page and try again.";
}
?>
The $old is the stuff that is already inside the txt file. The $new is the stuff sent through by a form.
I need $new to appear on top, with $old appearing below it.
Thanks in advance