Join Login

 html/PHP form not showing up
 by lstumpf - May 03, 2012

Hey all. Much like some other posters in this forum I tried following the youtube tutorial on how to create an html contact form that uses PHP to submit that form as an email. I'm going to paste my code below but also wondered if I was maybe saving files in the wrong place. I currently have all files saved in my htdocs folder WITHIN my MAMP folder. MAMP is on and connected and tested.
Please Help!
Thanks's my code:

if ($_POST['parse_var'] == "contactform") {

$emailTitle = 'New Message from your Website';
$yourEmail = '';

$emailField = $_POST['email'];
$nameField = $_POST['name'];
$messageField = $_POST['message'];

$body = <<<EOD
Email: $emailField <br />
Name: $nameField <br />
Message: $messageField <br />

$headers = "From: $emailField\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail("$yourEmail", "$emailTitle", "$body", "$headers");
$sent = "Thank 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" />

<table width="400" border="1" cellspacing="50" cellpadding="0">
<td align="left">contact me
<br /><br />
<form id="contactform" name="contactform" method="post" action="contact_form.php">
<table width="100%" border="0" cellpadding="3">
<td width="25%" align="right">name:</td>
<td width="75%"><label for="name"></label>
<input type="text" name="name" id="name" maxlength="30" size="30" value="<?php print "$nameField"; ?>" /></td>
<td align="right">email:</td>
<td><label for="email"></label>
<input type="text" name="email" id="email" maxlength="50" size="30" value="<?php print "$emailField"; ?>"/>
<td align="right">message:
<textarea name="message" id="message" cols="40" rows="5"><?php print "$messageField"; ?></textarea>
<td bgcolor="blue" align="right"><label>
<input type="reset" name="reset" id="reset" value="Reset" />
<input type="hidden" name="parse_var" id="parse_var" value="contactform" />
<input type="submit" name="submit" id="submit" value="Submit" />
<td colspan="2"><?php print "$sent"; ?></td>

United States
Joined:May 03, 2012
Home About Contact Forum Youtube Privacy Policy
Copyright © 2009-2011 RiverCityGraphix.All Rights Reserved.