I need help Im trying to get a form to work with PHP and it doesnt seem to be working.
I fill out the form and click submit. It changes to a blank white screen not displaying the thank you page or email the form fields. Any ideas? Thanks
<?
/*
Subject and email Variables.
Variables holds information and as shown below you have your subject variable and email variable. PHP is case sensitive
*/
$emailSubject = 'PHP Email Scripting';
$webMaster = 'mrjelly@hotmail.com';
/* Gathering Data Variables. */
$nameField = $_POST('name');
$addressField = $_POST('address');
$mobileField = $_POST('mobile');
$emailField = $_POST('email');
$typeField = $_POST('type of event');
$occassionField = $_POST('occassion');
$guestsletterField = $_POST('guests');
$body = <<<EOD
<br><hr><br>
Name: $name <br>
Address: $address <br>
Mobile: $mobile <br>
Email: $email <br>
Type: $type <br>
Occassion: $occassion <br>
Guests: $guests <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body,
$headers);
/* Results rendered as HTML */
$theResults = <<<EOD
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Revolution-Bookings</title>
<link href="css.css" rel="stylesheet" type="text/css" />
<link href="Revolution CSS.css" rel="stylesheet" type="text/css" />
<link href="Oceana CSS.css" rel="stylesheet" type="text/css" />
<link href="Oceana CSS 2.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style2 {
font-family: Arial, Helvetica, sans-serif;
font-size: xx-large;
color: #FFFFFF;
font-weight: bold;
}
.style3 {
color: #FFFFFF;
font-weight: bold;
}
-->
</style>
</head>
<body>
<div id = "content" >
<div id = "header"></div>
<div id = "nav">|||<a href="Index.html"> Home </a>||| <a href="Drinks Page.html">Drinks</a> ||| <a href="Galleries Page.html">Galleries</a> ||| <a href="Bookings Page.html">Bookings</a> |||</div>
<p> </p>
<div id = "main">
<p class="style2">THANK YOU FOR BOOKING</p>
<p class="style3"> </p>
<p class="style3">WE WILL CONFIRM YOUR DETAILS VIA E-MAIL AND LOOK FORWARD TO SEEING YOU SOON!</p>
</div>
<div id = "footer">
<div align="center">Copyright 2009 Revolution Bar - All rights reserved. Use of this site is subject to our Terms & Conditions and Privacy & Cookie Policy. Powered by 88Publish. </div>
</div>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>