Free Web Hosting Forum
(#1 (permalink))
Old
Junior Member
richdawg is on a distinguished road
 
Posts: 13
Join Date: Apr 2011
Default Contact Form redirecting - 07-06-2011, 03:52 AM

Hello,

I've created a contact form and php page using the code provided by Ribbit here. However, when I tried sending a test email, it redirects to the 000WebHost home page.

Any ideas on how to resolve this? Thanks in advance. http://www.richardhuante.site90.com/contact.html
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
Senior Member
totage is on a distinguished road
 
Posts: 199
Join Date: Jan 2011
Location: USA
Send a message via AIM to totage Send a message via MSN to totage Send a message via Yahoo to totage
Default 07-06-2011, 06:41 AM

Are redirecting to a valid page? double check to make sure.
Reply With Quote
(#3 (permalink))
Old
d3iti's Avatar
Super Moderator
d3iti is on a distinguished road
 
Posts: 4,606
Join Date: Jul 2009
Location: Spain
Default 07-06-2011, 07:17 AM

Hi,

If you get the 404 error message because the file is being called does not exist.

When someone clicks the submit button on your form, the data is sent to the file mailer.php.
Where have you saved the file mailer.php?


Si este mensaje te ha servido de ayuda no dudes en pulsar sobre el botón karma
Reply With Quote
(#4 (permalink))
Old
Junior Member
richdawg is on a distinguished road
 
Posts: 13
Join Date: Apr 2011
Default 07-06-2011, 07:34 AM

Hi,

Yes it's the 404 error. My php file is saved in the public folder with my html files, but it is named "contactformprocess.php". Should I rename it to "mailer.php"?
Reply With Quote
(#5 (permalink))
Old
Member
Hollend is on a distinguished road
 
Posts: 61
Join Date: May 2011
Default 07-06-2011, 10:43 AM

Look in contact.html for this line:
Code:
<form method="POST" action="mailer.php">
Change it to...
Code:
<form method="POST" action="contactformprocess.php">
This should work if contactformprocess.php is the actual mailer.php
Reply With Quote
(#6 (permalink))
Old
Junior Member
richdawg is on a distinguished road
 
Posts: 13
Join Date: Apr 2011
Default 07-06-2011, 05:22 PM

Hi guys,

I tried Hollend's and d3's suggestion and it worked. Thanks very much.

Now I need to figure out why I'm not receiving the emails. I've tried using my MSN and Yahoo email accounts, but neither works. What to do???
Reply With Quote
(#7 (permalink))
Old
Senior Member
RibbitHost is on a distinguished road
 
Posts: 279
Join Date: Jun 2011
Default 07-07-2011, 02:50 AM

Quote:
Originally Posted by richdawg View Post
Hi guys,

I tried Hollend's and d3's suggestion and it worked. Thanks very much.

Now I need to figure out why I'm not receiving the emails. I've tried using my MSN and Yahoo email accounts, but neither works. What to do???
May I see your whole code? My script should be working flawlessly...
Reply With Quote
(#8 (permalink))
Old
Junior Member
richdawg is on a distinguished road
 
Posts: 13
Join Date: Apr 2011
Default 07-07-2011, 07:33 PM

Hi Ribbit,

Code:
<?php
$to = "richardhuante@yahoo.com.com";
$subject = "Support requested by ".$_POST['name'];
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];

$headers = 'From: '.$_POST['email'].'' . "\r\n" .
   'Reply-To: '.$_POST['email'].'' . "\r\n" .
   'X-Mailer: PHP/' . phpversion();
 
$body = $message;

mail($to, $subject, $body, $headers );
header( 'Location: http://www.richardhuante.site90.com/contact.html' ) ; //replace with landing page.
?>
I've also tried it with my Squirrel Mail, but it still does'nt work.
Reply With Quote
(#9 (permalink))
Old
Senior Member
RibbitHost is on a distinguished road
 
Posts: 279
Join Date: Jun 2011
Default 07-07-2011, 07:55 PM

You have @yahoo.com.com
Reply With Quote
(#10 (permalink))
Old
Junior Member
richdawg is on a distinguished road
 
Posts: 13
Join Date: Apr 2011
Default 07-07-2011, 08:04 PM

Fixed the yahoo.com, but it still isn't working.

Code:
<?php
$to = "richardhuante@yahoo.com";
$subject = "Support requested by ".$_POST['name'];
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];

$headers = 'From: '.$_POST['email'].'' . "\r\n" .
   'Reply-To: '.$_POST['email'].'' . "\r\n" .
   'X-Mailer: PHP/' . phpversion();
 
$body = $message;

mail($to, $subject, $body, $headers );
header( 'Location: http://www.richardhuante.site90.com/contact.html' ) ; //replace with landing page.
?>
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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com