Join Login

 PHP form from tutorial
 by ndura - Nov 28, 2012

I followed the video and re-checked the code for a day. I cant seem to find an answer. My entire website is built in HTML, but the form is PHP like the video. Whenever I upload it or test it I check this error. "The requested URL /contact_form.php was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."

Heres the entire code:
if ($_POST['parse_var'] == "contactform"){

$emailTitle = 'New Email From Your Website!';
$yourEmail = '';

$emailField = $_POST['email'];
$nameField = $_POST['name'];
$projecttypeField = $_POST['projecttype'];
$timefrmaeField = $_POST['timeframe'];
$messageField = $_POST['message'];

$body = <<<EOD
Email: $emailField <br />
Name: $nameField <br />
Project Type:$projecttypeField <br />
Time Frame: $timefrmaeField <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" />
<title>Untitled Document</title>
<link href="try.css" rel="stylesheet" type="text/css" />


<div class="container">
<div class="header"><a href="index.html"><img src="images/IF_logo2.png" alt="infiniverse design logo" width="400" height="133" />&nbsp;&nbsp;&nbsp;&nbsp;</a><img src="images/facebook_mini.png" width="50" height="50" alt="Facebook" longdesc="" /><img src="images/tweet_mini.png" width="50" height="50" alt="Twitter" /><img src="images/linkedin_mini.png" width="50" height="50" alt="LinkedIn" /><!-- end .header --></div>
<p id="nav"><a href="index.html">Home</a> <a href="about.html">About</a> <a href="portfolio.html">Portfolio</a> <a href="services.html">Services</a> <a href="blog">Blog</a> <a href="contact.html">Contact</a></p>
<div class="content">
<img src="images/contact.png" alt="Contact" name="contact_img" width="250" height="125" id="contact_img" />
<table width="600" border="1" cellpadding="0" align="center">
<td align="center">Feel free to CONTACT me below...<br /> <br />
<form action="contact_form.php" method="post" name="contactform" target="_self" id="contactform">
<table width="100%" border="0" cellpadding="3">
<td width="28%" align="right">Name:</td>
<td width="72%" align="left"><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 align="left"><label for="email"></label>
<input type="text" name="email" id="email" maxlength="50" size="50" value="<?php print "$emailfield"; ?>" /></td>
<td align="right">Project Type:</td>
<td align="left"><label for="projecttype"></label>
<input type="text" name="projecttype" id="projecttype" maxlength="50" size="50" value="<?php print "$projecttypefield"; ?>" /></td>
</tr> <tr>
<td align="right">Time Frame:</td>
<td align="left"><label for="timeframe"></label>
<input type="text" name="timeframe" id="timeframe" maxlength="30" size="30" value="<?php print "$timeframefield"; ?>" /></td>
<td align="right">Message:</td>
<td><label for="message"></label>
<textarea name="message" id="message" cols="50" rows="7"><?php print "$messagefield"; ?></textarea></td>
<td align="left"><input type="hidden" name="parse_var" id="parse_var" value="contactform" /> <input type="submit" name="submit" id="submit" value="Submit &amp; Send to A Galaxy Not So Far Away" />
<input type="reset" name="reset" id="reset" value="Reset" /></td>
<td colspan="2"><?php print "$sent"; ?>&nbsp;</td>
<!-- end .content --></div>
<div class="footer">
<!-- end .footer --></div>
<!-- end .container --></div>

I appreciate any help. Im trying to get my portfolio up, and the video was great, but I cant get this thing working at all

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