php
We are going to create a php form
that will send you an email with the
information from the user and also
bring up a page that thanks the user
for filling out the form.
You will need to create a reply
(thanks.htm) page.
This php is only for a simple document
and does not have any built in additional security.
|
php
$email = $_REQUEST['email'] ;
For each "name" within the form
<input name="emailaddress" />
you must have a corresponding item in the POST section of your php
$_POST["emailaddress"] ."\n<>".
place your email address in the following section:
mail( "name@address.com"
Place in the following line the information that you want to have appear in the subject line of the email
"Feedback Form City Site",
Place the address of the reply page in the following section:
header( "Location: http://name.com/thanks.htm" );
As long as you include an name="email" in your form you will get the user's email address as the return address in the email you receive.
Use the code below without adding addition spaces.
<?
$email = $_REQUEST['email'] ;
$message =
$_POST["title"] ."\n".
$_POST["name"] ."\n<>".
$_POST["email"] ."\n<>".
$_POST["street"] ."\n<>".
$_POST["city"] ."\n<>".
$_POST["phone"] ."\n<>".
$_POST["other information"] ."\n<>".
$_POST["comments"] . "\n<>" .
$_POST["question"] ."<>";
mail( "name@address.com", "Feedback Form City Site",
$message, "From: $email" );
header( "Location: http://name.com/thanks.htm" );
|