Re: Form to Mail PHP
Thanks Gary
My original script was as you suggested. Then I got advised to add the
quotation marks. I've changed it back to what it was but with no luck. Any
advice would be much appreciated. Might it be because the contact form is
within an Spry accordion?
<?php
/* subject and email variables */
$emailSubject = 'Reservation Day Trip with Jimmy Felix';
$to = 'gustav@stage.co.za';
/* Gathering Data Variables */
$nameField = $_POST['name'];
$peopleField = $_POST['people'];
$timeField = $_POST['time9am10am'];
$timeField2 = $_POST['time12am1pm'];
$timeField2 = $_POST['check'];
$body = <<<EOD
<br><hr><br>
Name: $name <br>
People: $people <br>
Time: $time9am10am <br>
Time2: $time12am1pm <br>
TermsConditionsChecked: $check <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
ini_set("sendmail_from", "gustav@stage.co.za");
$success = mail($to, $emailSubject, $body, $headers);
/* Results rendered as HTML */
$theResults = <<<EOD
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<script src="SpryAssets/SpryEffects.js" type="text/javascript"></script>
<script src="SpryAssets/SpryAccordion.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if
((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
location.reload();
}
MM_reloadPage(true);
function MM_effectHighlight(targetElement, duration, startColor, endColor,
restoreColor, toggle)
{
Spry.Effect.DoHighlight(targetElement, {duration: duration, from: startColor,
to: endColor, restoreColor: restoreColor, toggle: toggle});
}
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
<link href="style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style2 {font-size: 85%}
-->
</style>
<link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
-->
</style>
</head>
<body>
<div id="Container">
<div id="Header">
<div class="HeaderText"> <span class="dottedUnderline">st.thomas day
trips</span> </div></div>
<div id="MainContent">
<div id="menu">
<div class="menu">
<p><span onclick="MM_goToURL('parent','index.html');return
document.MM_returnValue"
onmouseover="MM_effectHighlight(this, 100, '#ffffff', '#DDE2E0', '#ffffff',
true)"> home ::</span></p>
<p><span onclick="MM_goToURL('parent','about.html');return
document.MM_returnValue"
onmouseover="MM_effectHighlight(this, 100, '#ffffff', '#dde2e0', '#ffffff',
true)">about ::</span></p>
<p><span onclick="MM_goToURL('parent','maps.html');return
document.MM_returnValue"
onmouseover="MM_effectHighlight(this, 100, '#ffffff', '#dde2e0', '#ffffff',
true)">maps ::</span></p>
<p><span onclick="MM_goToURL('parent','gallery.html');retur n
document.MM_returnValue" onmouseover="MM_effectHighlight(this, 100, '#ffffff',
'#dde2e0', '#ffffff', true)">gallery ::</span></p>
<p><span onclick="MM_goToURL('parent','reservations.html'); return
document.MM_returnValue" onmouseover="MM_effectHighlight(this, 100, '#ffffff',
'#dde2e0', '#ffffff', true)">reservations ::</span></p>
</div>
</div>
<br />
<div id="Accordion1" class="Accordion" tabindex="0">
<div class="AccordionPanel">
<div class="AccordionPanelTab">:: CONFIRMATION</div>
<div class="AccordionPanelContent">
<div id="MainContentP">
<h1 class="Headings">Thank you for your reservation!</h1>
We appreciate your business
<p>Your driver's name is <span class="emphasisRedBold">Jimmy
Felix</span>.</p>
<p>Don't forget your camera!</p>
<p>Lastly, don't forget to tell a friend about this tour - and the free
Rum Punch at the Rum Factory...</p>
<p> </p>
<p> </p>
<p><br />
</p>
</div>
</div>
</div>
<div class="AccordionPanel">
<div class="AccordionPanelTab">:: REMEMBER</div>
<div class="AccordionPanelContent">
<div id="MainContentP">
<h1 class="Headings">Don't feed the inguanas!</h1>
<div class="floatLeft">
<img src="images/inguana.jpg" /> </div>Although we treat our inguanas
like you treat your labradors, they are prehistoric creatures who don't digest
man made food well.<br /><br />
Besides, we won't go about feeding your labradors. It's not cool! <br
/><br />
But don't worry, where I take you there aren't many inguanas.
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</div>
</div>
</div>
</div>
</div>
<div id="Footer">Powered by gandor.tv</div>
<div id="Footer2"></div>
</div>
<script type="text/javascript">
<!--
var Accordion1 = new Spry.Widget.Accordion("Accordion1");
//-->
</script>
</body>
</html>
EOD;
echo "$theResults";
?>
|