-
Email Form
I have been requested of the teacher incharge of the student council to set a little webpage so students in school and submit something on this form to put a suggestion.
This will go to a email address in school and want it to look something like:
Name:___________________
Comment:__________________
__________________________
__________________________
Submit.
But i am unsure how to set it. tried searching google with no preveil.
Thanks
Peter
-
Have a look at Google Docs - it can do all of this for you with ease.
-
Are you using IIS or Apache as your host and do you have any scripting (e.g. PHP) available to you? Is this a server you control?
-
If you have a server running .php you could do something like this:
Contact PHP Email Form Script with free contact php code
I must admit I've not tried it, it was just the first thing that appeared in a google search. For an easy life I would probably go with webmans solution.
-
I would second using Google forms, part of the Google Docs spreadsheet. We use them in the school I work for inset surveys and other data collection.
There's also more of a chance that others might pick up on how to use them.
If you decide to dive into php and hosting your own script there's one below I use for the sixth form students making websites in my school as a generic email form. for this to work the html form pointing to it must have a hidden filed called EmailAddress with the value being the recipient's email address.
Save the headache and do the Google thing though :-)
<html>
<head>
<title>Email Contact Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php // common.php
function info($msg) {
?>
<script language="JavaScript">
<!--
alert("<?=$msg?>");
history.back();
//-->
</script>
<?
exit;
}
?>
</head>
<body>
<?
/* get date */
$today = date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm
/* recipients */
$to = $_POST['EmailAddress'];
/* subject */
$subject = "Email Contact Form";
/* message */
$message = "
$today
Senders details -
";
/* message continued - get details from form */
foreach ($_POST as $key => $value) {
if ($key != "email" && $key != "submit") {
$message .= $key ." : ". $value . "\n";
}
}
/* and now mail it */
mail($to, $subject, $message,
"From: form2email@yourdomain.com\r\n" .
"Reply-To: form2email@yourdomain.com\r\n"
);
info("Thank you, your email has been received.");
?>
</body>
</html>