logo-dw

Go Back   Dreamweaver Club Forums > Dreamweaver forums > Spry
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 02-09-2011, 04: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
Old 02-10-2011, 12:33 AM   #2
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

it returns a 404 page not found so your path is wrong
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is online now   Reply With Quote
Old 02-10-2011, 04:08 PM   #3
currysteph
 
Join Date: Feb 2011
Posts: 7
Default

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 is offline   Reply With Quote
Old 02-10-2011, 04:26 PM   #4
currysteph
 
Join Date: Feb 2011
Posts: 7
Default

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

thanks
currysteph is offline   Reply With Quote
Old 02-10-2011, 11:56 PM   #5
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

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
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is online now   Reply With Quote
Old 02-14-2011, 03:42 PM   #6
doakh
 
Join Date: Feb 2011
Posts: 8
Default

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.

Last edited by doakh; 02-14-2011 at 03:51 PM..
doakh is offline   Reply With Quote
Old 02-14-2011, 10:10 PM   #7
doakh
 
Join Date: Feb 2011
Posts: 8
Default

Quote:
Originally Posted by doakh View Post
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.'
doakh is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:43 AM.


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