Just use the code
<?php
$name = $_POST['name'];
$message = $_POST['message'];
$type = $_POST['type'];
$email = $_POST['email'];
$write2file = '
Name = '.$name.'
Message = '.$message.'
Type = '.$type.'
E-Mail = '.$email.'
';
$file2write = 'path/to/your/file.dat';
$write = @fopen($file2write,"w");
@fwrite($write, $write2file);
@fclose($write);
if($write){echo 'Your message has been submitted !';}
else{echo 'ERROR : Your message has not been submitted !';}
?>
Save that in post.php
In the page you want to show, write
<form action="post.php" method="post">
Name<input type="text" name="name"><BR>
Email<input type="text" name="email"><BR>
Type
<select name="type">
<option value="complaint">Complaint</option>
<option value="suggestion">Suggestion</option>
<option value="question">Question</option>
<option value="idea">Idea for comic</option>
<option value="other">Other</option>
</select><BR>
<textarea name="message"></textarea><BR>
<input type="submit">
</form>
Hi, I have tested your code, it works.
But there is a problem, in the file where the message goes, the latest post overwrites all the others.
you only have the latest post in other words.
Could someone who is good with scripts fix this?
Thanks, John