Here's a very easy way to set up a comment form on any web page:
Code:
<form method="post" action="mailto:yourname@yoursite.com" enctype="text/plain">
Your e-mail:<br> <input type="text" name="email"><br><br>
Your comments:<br> <textarea name="comments"></textarea><br><br>
<input type="submit" value="Submit Your Comments">
</form>
However, it doesn't support file attachments and it doesn't work in all browsers. What you will probably need is a script to handle the form input.
First create an HTML page for the form:
form.html
Code:
<form method="post" action="send.php" enctype="multipart/form-data">
Your e-mail:<br> <input type="text" name="email"><br><br>
Your comments:<br> <textarea name="comments"></textarea><br><br>
Attachment?<br> <input name="attachment" type="file"><br><br>
<input type="submit" value="Submit Your Comments">
</form>
Then make a script to handle it:
send.php
Code:
<?
$file = fopen($_FILES['attachment']['tmp_name'],'rb');
$data = fread($file,filesize($_FILES['attachment']['tmp_name']));
fclose($file);
unlink($_FILES['attachment']['tmp_name']);
$data = chunk_split(base64_encode($data));
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$headers = "From: ".$_POST['email'];
$headers .= "\nMIME-Version: 1.0\nContent-Type: multipart/mixed;\n boundary=\"{$mime_boundary}\"";
$email_message = $_POST['comments']."\n\n";
$email_message .= "--{$mime_boundary}\nContent-Type:text/html; charset=\"iso-8859-1\"\nContent-Transfer-Encoding: 7bit\n\n" . $email_message . "\n\n";
$email_message .= "--{$mime_boundary}\nContent-Type: {$_FILES['attachment']['type']};\n name=\"{$_FILES['attachment']['name']}\"\nContent-Transfer-Encoding: base64\n\n" . $data . "\n\n--{$mime_boundary}--\n";
$ok = @mail("youremail@host.com", "Feedback", $email_message, $headers);
if ($ok) {
echo "Your feedback was sent.";
} else {
die("Sorry but the email could not be sent.");
}
?>
Untested but should work. Hope this helps!
-Y