Please Help PHP Problem Submitting Form
Hi there,
I am a complete web design novice, but am trying to finish off a site for my small video production business.
I am using Dreamweaver CS3 and been following tutorials up to this point, but am stuck on the last part which is submitting a form. After following a tutorial, I got the submit button to work (send a message to my e-mail), however all the field are blank as opposed to having text within their fields. I have put below the script both of my form, and of my PHP document:
Form:
<form action="phptest.php" name="ContactForm" target="_blank" id="ContactForm">
<div>
<div class="wrapper"><div class="bg"><input name="Name" type="text" class="input" id="Name" onFocus="if(this.value =='Name' ) this.value=''" onblur="if(this.value=='') this.value='Name'" value="Name" >
</div></div>
<div class="wrapper"><div class="bg"><input name="email" type="text" class="input" id="email" onFocus="if(this.value =='E-mail' ) this.value=''" onblur="if(this.value=='') this.value='E-mail'" value="E-mail" ></div></div>
<div class="wrapper"><div class="bg2"><textarea name="questions" cols="1" rows="1" id="questions" onFocus="if(this.value =='Questions/Comments' ) this.value=''" onBlur="if(this.value=='') this.value='Questions/Comments'" >Questions/Comments</textarea></div></div>
<div class="wrapper">
<table width="300" border="1">
<tr>
<td><input name="reset" type="reset" class="button" id="reset2" accesskey="r" tabindex="140" value="reset"></td>
<td><input name="submit2" type="submit" class="button" id="submit2" accesskey="s" tabindex="160" value="submit"></td>
</tr>
</table>
</div>
</div>
</form>
PHP DOC:
<?php
/* Email test */
$emailSubject = 'Crazy PHP Scripting!';
$webMaster = 'info@dcmcvideography.ca';
/* Gathering Data Variables */
$NameField = $_POST['Name'];
$emailField = $_POST['email'];
$questionsField = $_POST['questions'];
$body = <<<EOD
<br><hr><br>
Name: $Name <br>
Email: $email <br>
Questions: $questions <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 xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>Hello Thanks
</body>
</html>
EOD;
echo "$theResults";
?>
Any help would be greatly appreciated. Thanks!
