Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-10-2013, 05:57 AM   PM User | #1
aaronSSE
New to the CF scene

 
Join Date: Feb 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
aaronSSE is an unknown quantity at this point
Need help urgently! Php script not working

Ive just designed my first contact form for my website so people can sign up to sell tickets to the event but when they click submit it goes to a blank page that says theResults instead of staying on the main page and having a drop down saying the Success message. I then receive a email but the email has no information in it.

Here is my PHP code
PHP Code:
<?php

/* Subject and Email Variables */

$emailSubject 'Insomnia All Ages Promoters';
$webMaster 'aaron@superbsoundentertainment.com';

/* Gathering Data Variables */

$nameField $_POST['name'];    
$emailField $_POST['email'];
$mobileField $_POST['mobile'];
$schoolField $_POST['school'];
$dobField $_POST['dob'];
$addressField $_POST['address'];
$whyField $_POST['why'];

$body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>
Mobile: $mobile <br>
School: $school <br>
DOB: $dob <br>
Address: $address <br>
Why: $why <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>
<title>JakesWorks - travel made easy-Homepage</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-color: #f1f1f1;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #666666;
text-decoration: none;
}
-->
</style>
</head>

<div>
<div align="left">Thank you for signing up! We will be in touch very soon! Kind regards the team at Superb Sound Entertainment</div>
</div>
</body>
</html>
EOD;
echo 
"theResults";    


?>
can someone either change the code for me or tell me where I need to fix it thanks

here is a link to the website http://insomniau18s.com

Kind Regards
Aaron
aaronSSE is offline   Reply With Quote
Old 02-10-2013, 05:15 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,498
Thanks: 18
Thanked 362 Times in 361 Posts
sunfighter is on a distinguished road
Not going back to that site again and don't think I'd stay long enough to fill out your form, but :
$nameField = $_POST['name'];

Maybe $name = $_POST['name']; to make things work.
sunfighter is offline   Reply With Quote
Old 02-10-2013, 05:24 PM   PM User | #3
djm0219
Senior Coder

 
djm0219's Avatar
 
Join Date: Aug 2003
Location: Wake Forest, North Carolina
Posts: 1,229
Thanks: 2
Thanked 190 Times in 188 Posts
djm0219 is on a distinguished road
echo "theResults"; should be echo $theResults;
__________________
Dave .... HostMonster for all of your hosting needs
djm0219 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:45 AM.


Advertisement
Log in to turn off these ads.