View Single Post
Old 02-09-2011, 05:26 PM   #1
currysteph
 
Join Date: Feb 2011
Posts: 7
Question Need help with Contact page (formmail.php)

Can someone tell me why this isnt working?

www.thecurrys.us
(click the red envelope icon)

2 things...

1. after info is entered it doesnt goto the thankyou.html page
2. the info is not sent to my email address.

Im sure the problem lies either within the formmail.php
or
I do not have the formmail.php in the right location...currently it is in the root folder of the website.

Here is the code within the formmail.php

--------------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<META HTTP-EQUIV="refresh" content="0;URL=thankyou.html">
<title>Email Form</title>
</head>

<body>
<?php
$name=addslashes($_POST['name']);
$email=addslashes($_POST['email']);
$comments=addslashes($_POST['message']);

// you can specify which email you want your contact form to be emailed to here

$toemail = "my_email_address@gmail.com";
$subject = "From: thecurrys.us Website";

$headers = "MIME-Version: 1.0\n"
."From: \"".$name."\" <".$email.">\n"
."Content-type: text/html; charset=iso-8859-1\n";

$body = "Name: ".$name."<br>\n"
."Email: ".$email."<br>\n"
."Comments:<br>\n"
.$comments;

if (!ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email))
{
echo "That is not a valid email address. Please return to the"
." previous page and try again.";
exit;
}

mail($toemail, $subject, $body, $headers);
echo "Thanks for submitting your comments";
?>
</body>
</html>

-----------------------

thanks for any help
currysteph is offline   Reply With Quote