PDA

View Full Version : PHP form help PLEASE


kidztar
10-31-2011, 10:56 PM
Can anyone tell me what is wrong with this script? The form will email me, however it only shows this
name:
email:
Ship:
and so on, the information the client fills out does not get sent to my email

<?php

/* Subject and Email Variables */

$emailSubject = 'Orders from website!';
$Kidztar = 'kidztar@yahoo.com';

/* Gathering Data Variables */

$nameField = $_POST['name'];
$phoneField = $_POST['phone'];
$emailField = $_POST['email'];
$shipField = $_POST['ship'];
$childField = $_POST['child'];
$certnameField = $_POST['certname'];
$certphotoField = $_POST['certphoto'];
$friendField = $_POST['friend'];
$uploadField = $_POST['upload'];

$body = <<<EOD
<br><hr><br>
Name: $name <br>
Phone: $phone <br>
Email: $email <br>
Ship: $ship <br>
Child: $child <br>
Certname: $certname <br>
Certphoto: $certphoto <br>
Friend: $friend <br>
Photo: $upload <br>
EOD;

$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($Kidztar, $emailSubject, $body, $headers);

/* Results rendered as HTML */

$theResults = <<<EOD
<html>
<head>
<title>colorback</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body bgcolor="#FFFFFF">
<!-- ImageReady Slices (colorback.psd) -->
<table id="Table_01" width="800" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="7">
<img id="thankyou_01" src="images/thankyou_01.png" width="800" height="73" alt="" /></td>
</tr>
<tr>
<td>
<img id="thankyou_02" src="images/thankyou_02.jpg" width="85" height="55" alt="" /></td>
<td>
<img id="thankyou_03" src="images/thankyou_03.jpg" width="89" height="55" alt="" /></td>
<td>
<img id="thankyou_04" src="images/thankyou_04.jpg" width="89" height="55" alt="" /></td>
<td>
<img id="thankyou_05" src="images/thankyou_05.jpg" width="90" height="55" alt="" /></td>
<td>
<img id="thankyou_06" src="images/thankyou_06.jpg" width="123" height="55" alt="" /></td>
<td>
<img id="thankyou_07" src="images/thankyou_07.jpg" width="169" height="55" alt="" /></td>
<td>
<img id="thankyou_08" src="images/thankyou_08.jpg" width="155" height="55" alt="" /></td>
</tr>
<tr>
<td colspan="7">
<img id="thankyou_09" src="images/thankyou_09.png" width="800" height="449" alt="" /></td>
</tr>
<tr>
<td colspan="7">
<img id="thankyou_10" src="images/thankyou_10.png" width="800" height="23" alt="" /></td>
</tr>
</table>
<!-- End ImageReady Slices -->
</body>
</html>
EOD;
echo "$theResults";

?>

edbr
11-02-2011, 01:17 AM
You variable names dont match
$nameField = $_POST['name'];
$phoneField = $_POST['phone'];
$emailField = $_POST['email'];
$shipField = $_POST['ship'];
$childField = $_POST['child'];
$certnameField = $_POST['certname'];
$certphotoField = $_POST['certphoto'];
$friendField = $_POST['friend'];
$uploadField = $_POST['upload'];

whiloe your mesage looks for Name: $name <br> for example

it should read $nameField = $_POST['name'];
$phone= $_POST['phone'];
$email= $_POST['email'];
$ship= $_POST['ship'];
$child = $_POST['child'];
$certname= $_POST['certname'];
$certphoto= $_POST['certphoto'];
$friend= $_POST['friend'];
$upload= $_POST['upload'];

kidztar
11-02-2011, 01:56 AM
Sir edbr (http://www.dreamweaverclub.com/forum/member.php?u=22485)
You are a genius! Thank so much, I just had to take out Field. Now if I can just figure out how to get the file upload to post when uploaded I am set.

Anyone know of a Thread on here to help me with that issue?
Thanks
Kidztar