Created
March 26, 2009 15:10
-
-
Save mrchrisadams/86148 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="contact_form"> | |
<form method="post" action="php/sendmail.php"> | |
<fieldset> | |
<legend>Name</legend> | |
<div class="form_line"> | |
<label>First Name</label> <input type="text" name="firstname" value="" id="first_name" /> | |
</div> | |
<div class="form_line"> | |
<label>Surname</label> <input type="text" name="surname" value="" id="surname" /> | |
</div> | |
</fieldset> | |
<fieldset> | |
<legend>Contact details</legend> | |
<div class="form_line"> | |
<label>Phone number</label><input type="text" name="tel_no" value="" id="phone_number" /> | |
</div> | |
<div class="form_line"> | |
<label>Mobile phone number</label><input type="text" name="mobile_no" value="" id="mobile_number" /> | |
</div> | |
<div class="form_line"> | |
<label>Email:</label> <input type="text" name="email" /> | |
</div> | |
<div class="form_line"> | |
<label>Website:</label> <input type="text" name="website" /> | |
</div> | |
</fieldset> | |
<fieldset> | |
<div class="form_line"> | |
<label>Message</label> | |
<textarea name="message" rows="15" cols="40"> | |
</textarea> | |
</div> | |
<br /> | |
<p><input type="submit" value="Send Message" /></p> | |
</fieldset> | |
</form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$firstname = $_REQUEST['firstname'] ; | |
$surname = $_REQUEST['surname'] ; | |
$tel_no = $_REQUEST['tel_no'] ; | |
$mobile_no = $_REQUEST['mobile_no'] ; | |
$email = $_REQUEST['email'] ; | |
$website = $_REQUEST['website'] ; | |
$message = $_REQUEST['message'] ; | |
if (!isset($_REQUEST['email'])) { | |
header( "Location: http://www.domain.com/feedback.html" ); | |
} | |
elseif (empty($email) || empty($message)) { | |
header( "Location: http://www.domain.com/feedback.html" ); | |
} | |
else { | |
mail( "[email protected]", "Feedback Form Results", | |
$message, "From: $firstname$surname from $email\n Phone number: $tel_no\nMobile number: $mobile_no\nWebsite:$web\nWebsiteMessage:\n$message" ); | |
header( "Location: http://www.domain.com/thankyou.html" ); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment