Hi guys,
ive been slogging this for about 3 hours and just ant get it to work. I was hoping someone could tell me why.
The actual form itself works the bit I'm having trouble with is the end. I want it to send the form to my email address and display the info. I cant seem to get it to display all the info collected. At most it will display the title and firstname but not any other field.
Below is the code.
------------------------------------
Code: Select all
<?php
$title = $_REQUEST['title'] ;
$firstname = $_REQUEST['firstname'] ;
$surname = $_REQUEST['surname'] ;
$address = $_REQUEST['address'] ;
$postcode = $_REQUEST['postcode'] ;
$telephone = $_REQUEST['telephone'] ;
$email = $_REQUEST['email'] ;
$companyname = $_REQUEST['companyname'] ;
if (!isset($_REQUEST['email'])) {
header( "Location: http://www.purplecresscatering.com/contact.html" );
}
elseif (empty($email)) {
?>
<html>
<head><title>Error</title></head>
<body>
<h1>Error</h1>
<p>
Oops, it appears you forgot to enter either your
email address. Please press the BACK
button in your browser and try again.
</p>
</body>
</html>
<?php
}
else {
mail( "nealhendes@hotmail.com", "Contact Form Results", $title, $firstname, $surname,
$address, $postcode, $telephone, $email, $companyname "From: $email" );
header( "Location: http://www.purplecresscatering.com" );
}
?>
Thanks in advance and i'm sorry if this is a complete novice question. Only started learning today.
Neal.