- This topic is empty.
-
AuthorPosts
-
April 5, 2009 at 2:38 pm #24504wingyeMember
Hi there,
I have been looking on the internet to fix my lil problem i have with my contact form. But i doesnt seem to find the answer for it. Thats why i am going to bothering you guys here and hope you dont mind and help me out with this problem which is really small for most of you but for me its a disaster.
My problem is as follow:
I have a contact form in HTML when press submit it use PHP script to mail to me.
But when error or succes it redirect to a specific page. But unfortunately i cant get this to work.Below is the form n HTML
Code:And here is the PHP script
Code:“;
exit;
}// prepare email body text
$Body = “”;
$Body .= “name: “;
$Body .= $name;
$Body .= “n”;
$Body .= “company: “;
$Body .= $company;
$Body .= “n”;
$Body .= “tel: “;
$Body .= $tel;
$Body .= “n”;
$Body .= “email: “;
$Body .= $email;
$Body .= “n”;
$Body .= “message: “;
$Body .= $message;
$Body .= “n”;// send email
$success = mail($EmailTo, $Subject, $Body, “From: <$EmailFrom>“);// redirect to success page
if ($success){
print ““;
}
else{
print ““;
}
?>I hope you guys can help me out,
Thanks Alot for your time
April 6, 2009 at 3:28 pm #55898wingyeMemberIs there anyone who can help me out with this bit pls ..
April 6, 2009 at 3:39 pm #55899apostropheParticipantNot sure what you are asking.
The whole thing doesn’t work or just the page redirect?April 6, 2009 at 5:42 pm #55896wingyeMemberthnx for you time, well its the whole thing that doesnt work.
It doesnt send any mail out and it keep redirecting to the error page not matter what.wing
April 6, 2009 at 6:26 pm #55897ikthiusMemberdoing a basic test can help see where it is dying, like at each stage, write something out to the page:
e.g. if your php filled the body of the mail, echo it out, perform something for each stage to see when it dies…
echo = "body populated";"wingye" wrote:thnx for you time, well its the whole thing that doesnt work.
It doesnt send any mail out and it keep redirecting to the error page not matter what.wing
are you on a windows server?
if so you need to set your ini in phpplus enquiry & message are not the same!!! you might want to change one.
mind you it looks like the script I use, but I $_REQUEST my HTML elements
e.g.
Code:$name = $_REQUEST[‘name’];
$tel = $_REQUEST[‘tel’];
$email = $_REQUEST[’email’];also this is my success:
$success = mail($EmailTo, $Subject, $Body, "From: <$email>", "-froot@my-email-address");hopefully these small hints may help get it working
May 11, 2009 at 11:00 am #57404raymondseldaMemberMaybe I can help you with your problem. I have written an article on my blog on creating a contact form using PHP and jQuery for validation. It’s really simple and short. I hope you will find my article helpful. Thank you.
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.