Join Login

Adobe Production Premium CS5.5
 Contact Form tutorial problem
 by The pokemon kid - Oct 17, 2011


I followed the tutorial to make the contact form.

I cheated a little and used a template to make it look a little nice. I used the "Various" - "higher" one. Its pretty much the same one which was made in the tutorial except for a CSS styling behind it...

I followed the guide to the tee and I uploaded it onto the server and it wont work. I split the PHP and the html into two separate files. As many other tutorials did.

The website is currently at: ""

The code for the HTML page is:

<form id="Contactform" name="Contactform" method="post" action="ContactForm.php">
<table class="form">
<th><label for="input-one"><strong>First Name:</strong></label></th>
<td><input name="NameInput" id="NameInput" type="text" size="30" class="text-input" maxlength="30" value=" <?php print "$FirstNameField"; ?>" /></td>

<th><label for="input-two"><strong>Surname:</strong></label></th>
<td><input name="SurnameInput" id="SurnameInput" type="text" size="30" maxlength="30" class="text-input" value="<?php print "$SurnameField"; ?>" /></td>

<th><label for="input-three"><strong>Email Address:</strong></label></th>
<td><input name="EmailInput" id="EmailInput" type="text" size="50" maxlength="50" class="text-input" value="<?php print "$EmailField"; ?>" /></td>

<th class="message-up"><label for="message"><strong>Message:</strong></label></th>
<textarea name="MessageInput" id="MessageInput" cols="30" rows="5" ><?php print "$MessageField"; ?></textarea>

<th class="input-three"><label for="question"><strong>Question:</strong></label></th>
<td><samp>99&nbsp;+&nbsp;11&nbsp;=</samp> &nbsp; <input name="spam-protection" id="question" type="text" size="5" class="antispam" />
<span><strong>(spam protection)</strong></span></td>

<td class="submit-button-right" colspan="2">
<input class="submit-text" type="submit" value="Send" />
<input type="hidden" name="ParseVar" id="ParseVar" value="Contactform" />
<input name="Reset" type="reset" class="submit-text" id="Reset" value="Reset" /></td>
<th colspan="2"> <?php print "$Sent"; ?></th>

The PHP code is:

if <$_POST['ParseVar'] == "Contactform"> {

$EmailTitle = 'New email From';
$YourEmail = '';

$EmailField = $_POST ['EmailInput'];
$FirstNameField = $_POST ['NameInput'];
$SurnameField = $_POST ['SurnameInput'];
$MessageField = $_POST ['MessageInput'];

$body = <<<EOD
Firstname: $FirstNameField <br />
Surname: $SurnameField <br />
Email: $EmailField <br />
Message: $MessageField <br />

$headers = "From:$EmailField\r\n";
$headers .= "Content-Type: text/html\r\n";
$success = mail <"$YourEmail", "$EmailTitle", "$body", "$headers">;

$Sent = "Thank You! Your message has been sent.";


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />



If anyone could please help me it would be greatly appricated, Im only starting at PHP and i am a bit of a newbie.

Thanks Mat

The pokemon kid
United Kingdom
Joined:Oct 17, 2011
Home About Contact Forum Youtube Privacy Policy
Copyright © 2009-2011 RiverCityGraphix.All Rights Reserved.