Dreamweaver Club Forums

Dreamweaver Club Forums (http://www.dreamweaverclub.com/forum//index.php)
-   Spry (http://www.dreamweaverclub.com/forum//forumdisplay.php?f=189)
-   -   Need help with Contact page (formmail.php) (http://www.dreamweaverclub.com/forum//showthread.php?t=39047)

currysteph 02-09-2011 05:26 PM

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

edbr 02-10-2011 01:33 AM

it returns a 404 page not found so your path is wrong

currysteph 02-10-2011 05:08 PM

I dont know...the path seems correct....

although I now have changed the line in the .php file from

<META HTTP-EQUIV="refresh" content="0;URL=/thankyou.html">

to

<META HTTP-EQUIV="refresh" content="0;URL=http://www.thecurrys.us/thankyou.html">

but still with the same results.

The remote server also shows the thankyou.html in the root folder...so i dont understand why I keep getting this 404 message

currysteph 02-10-2011 05:26 PM

if you see the error can you point it out to me as I have no idea where the wrong path could be?

thanks

edbr 02-11-2011 12:56 AM

http://www.thecurrys.us/formmail.php returns the 404 so where is this file this is the action . i would forget meta refresh and use location: after the mail has been actioned

doakh 02-14-2011 04:42 PM

You need to look at the $my_email variable to sure your syntax is correct. Also check the variable $continue = "/" . The reponse email code needs to be inside a (dwt) master page which is in your PHP email file after all your php code (?>). This way your email response is not a blank page with the message.

doakh 02-14-2011 11:10 PM

Quote:

Originally Posted by doakh (Post 190059)
You need to look at the $my_email variable to sure your syntax is correct. Also check the variable $continue = "/" . The reponse email code needs to be inside a (dwt) master page which is in your PHP email file after all your php code (?>). This way your email response is not a blank page with the message.

Whoops, I have the wrong program. I am using 'FormtoEmail' not 'Formmail.'


All times are GMT. The time now is 07:55 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com