Hi all
Need some help, I have set a form and the info is sent to a text file, all this works put i would like the next info to load @ the top not the bottom of the text file, scanned the internet, could not get any sence, could someone have alook and get me where I am going wrong,.
thanks
<html>
<head>
<title>Thank you</title>
</head>
<body>
<?php
$d = date("r");
$file = "list.txt";
$file2 = "email_list.txt";
$name = $POST['name'];
$email = $POST['email'];
$subject = $POST['subject'];
$msg = $POST['msg'];
if(empty($email) || empty($subject) || empty($name) || empty($msg)) {
echo "<h1>All fields are required</h1>";
}
elseif(!ereg("[a-z0-9-]+(.[a-z0-9-]+)@[a-z0-9-]+(.[a-z0-9-]+)(.[a-z]{2,3})$", $email)) {
echo "<h1>Must enter your email address</p>";
} else {
$fp = fopen($file,"a");
fwrite($fp, "
$subject
$msg
$name
$d");
fclose($fp);
echo "<h1><b><center>Thank's for the update $name<br>phone you soon Lee</b></center></h1>"; }
?>
</body>
</html>