Jump to content

[SOLVED] Help with PHP Email SCript


bloodlinek0

Recommended Posts

Okay it may be easier to do it this way:

 

This is my current php code that is not working...if you can see what I need to change and specifically tell me what it is and where it goes in the script, I'll probably be able to figure out backwards how it works.

 

<?php

/* Subject and Email Variables */

$emailSubject = 'ITMB Form Submission';
$webMaster = '[email protected]';

/*Gathering Data Varialbes */

$forename = $_POST['forename'];
$company = $_POST['company'];
$position = $_POST['position'];
$address = $_POST['address'];
$city = $_POST['city'];
$potscode = $_POST['postcode'];
$telephone = $_POST['telephone'];
$email = $_POST['email'];
$businessmobiles = $_POST['businessmobiles'];
$blackberrysolutions = $_POST['blackberrysolutions'];
$other = $_POST['other'];
$timescale = $_POST['timescale'];
$comments = $_POST['comments'];

$body = <<<EOD
<br><hr><br>
Name: $forename <br>
Company: $company <br>
Postion: $position <br>
Address: $address <br>
City: $city <br>
Postcode: $postcode <br>
Telephone: $telephone <br>
Email: $email <br>
Business Mobiles: $businessmobiles <br>
Blackberry Solutions: $blackberrysolutions <br>
Other: $other <br>
Timescale: $timescale <br>
Comments: $comments <br>

EOD;

$headers = "MIME-Version: 1.0\r\n"; 
$headers .= "Content-Type: text/html; charset=us-ascii\r\n"; 

mail($webMaster, $emailSubject, $body, $headers);

/*Results Rendered as html*/

$theResults = <<<EOD
	<html>

	<head>

		 <meta name="description" content="" />
		  <meta name="keywords" content="" />
		   <meta name="author" content="Dazan Alyanai" />
		    <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />

		<title>ITMB</title>

			<link rel="shortcut icon" HREF="favicon.ICO">

			<script type="text/javascript" src="assets/flash/swfobject.js"></script>
			<script type="text/javascript">
				var flashvars = {};
				var params = {};
				params.menu = "false";
				params.quality = "best";
				params.scale = "noscale";
				var attributes = {};
				swfobject.embedSWF("assets/flash/logo.swf", "logo", "341", "86", "9.0.0", "assets/flash/expressInstall.swf", flashvars, params, attributes);
			</script>


	    <link rel="stylesheet" type="text/css" href="styles.css">
	     <style type="text/css">
		     <!--	 		 

			 -->
		   </style>

	</head>
	 <body>
	  <div id="wrapper">

	   <div id="head">

		<div id="nav" style="float: right">
		 <ul> 
				<li class="link"><a href="index.html">Home</a></li>
				<li class="link"><a href="about.html">About Us</a></li>
				<li class="link"><a href="web.html">Web</a></li>
				<li class="link"><a href="plans.html">Plans</a></li>
				<li class="link"><a href="partnerships.html">Partnerships</a></li>
				<li class="link" id="active"><a href="contact.html">Contact</a></li>

		 </u>
		</div>
			<div id="logo">
				<img src="assets/images/logo.gif" alt="ITMB" />
			</div>

	   </div>

	<!--Flash Banner-->
	   <div id="banner">
		<img src="assets/images/contact_banner.jpg" />
	   </div>

	<!--Row 1 Header Content (About Us..)-->
	   <div id="content_top">
		<img src="assets/images/thank_you.gif" alt="Thank You">
	   </div>

	<!--Content-->

	   <div class="text_only" style="height: 220px">	
				<img src="assets/images/tick.jpg" alt="Tick" style="float: left; padding: 20px 20px 0 20px"/>
		<h4>Thank You for your submission.</h4>
		 <h4>Your request will be dealt with as soon as possible and one of our representatives will contact you shortly.</h4>
		 <p>Return to the <a href="index.html" class="standlink">Home Page</a></p>
	</div>

	<!--Footer-->	
		<br>
	<img src="assets/images/networks.jpg" alt="Networks" style="margin-left: 750px" />
	<div id="footer">
	<address>ITMB | Copyright 2009 | All Rights Reserved</address><address style="float: left"><a class="standlink" href="index.html">ITMB</a>&#160;Registered Company Number: 06925752</address>
	</div>

	 </body>

	</html>

EOD;
echo "$theResults";



?>

 

As suspected the issue is with a difference between your HTML and your PHP. You have name="Timescale" in your HTML and you are using $_POST['timescale'] in your PHP (array keys are case sensitive). Thi is something that you should have been able to pickup by looking at the output from print_r($_POST) as the array key would have been differen't to what you were calling in PHP.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.