I have downloaded a theme here on themeforest but get no repsonse for support from developers. I was wondering if anyone here can help. I would like to redirect upon form submission. I tried everything the internet directed me to believe me.. still nothing works. Any php experts? Here is my code below.
<?php if(isset($_POST[‘name’]) && isset($_POST[‘email’]) && isset($_POST[‘message’])) {
//Insert your email address
$mailTo = "davebruzzese@gmail.com";
//Insert the default subject of the email
$defaultSubject = "Benefits of an Automated Time Clock Solution-Landing Page";
(isset( $_POST['subject'] ) ) ? $subject = $_POST['subject'] : $subject = $defaultSubject;
$name = htmlspecialchars(urldecode($_POST['name']));
$mailFrom = htmlspecialchars(urldecode($_POST['email']));
$message_text = htmlspecialchars($_POST['message']);
$headers = 'Content-type: text/html; charset=UTF-8' . "\r\n";
$headers .= 'From: '.$mailFrom;
$message = "
<head>
<title> $subject </title>
</head>
Benefits of an Automated Time Clock Solution - Landing Page
Name/Company name: $name
E-mail: $mailFrom
";
$message .= "Message:
$message_text
";
if (mail($mailTo, $subject, $message, $headers)) header(“Location: www.google.com”); else { echo “Some errors occurred, try again.”; }
} ?>
THANKS!!! ANY HELP GREATLY APPRECIATED
dbruzzese84 said
<?php if(isset($_POST['name']) && isset($_POST['email']) && isset($_POST['message'])) { //Insert your email address $mailTo = "davebruzzese@gmail.com"; //Insert the default subject of the email $defaultSubject = "Benefits of an Automated Time Clock Solution-Landing Page"; (isset( $_POST['subject'] ) ) ? $subject = $_POST['subject'] : $subject = $defaultSubject; $name = htmlspecialchars(urldecode($_POST['name'])); $mailFrom = htmlspecialchars(urldecode($_POST['email'])); $message_text = htmlspecialchars($_POST['message']); $headers = 'Content-type: text/html; charset=UTF-8' . "\r\n"; $headers .= 'From: '.$mailFrom; $message = " <head> <title> $subject </title> </head> Benefits of an Automated Time Clock Solution - Landing Page <br /> <b>Name/Company name:</b> $name<br /><br /> <b>E-mail:</b> $mailFrom<br /><br />"; $message .= "<b>Message:</b><br /> <p>$message_text</p> "; if (mail($mailTo, $subject, $message, $headers)) header("Location: www.google.com"); else { echo "Some errors occurred, try again."; } } ?>
That’s some messed up code. I’m hoping it’s not a WordPress theme.
<?php
if(isset($_POST[‘name’]) && isset($_POST[‘email’]) && isset($_POST[‘message’])) {
//Insert your email address
$mailTo = "davebruzzese@gmail.com";
//Insert the default subject of the email
$defaultSubject = "Benefits of an Automated Time Clock Solution-Landing Page";
(isset( $_POST['subject'] ) ) ? $subject = $_POST['subject'] : $subject = $defaultSubject;
$name = htmlspecialchars(urldecode($_POST['name']));
$mailFrom = htmlspecialchars(urldecode($_POST['email']));
$message_text = htmlspecialchars($_POST['message']);
$headers = 'Content-type: text/html; charset=UTF-8' . "\r\n";
$headers .= 'From: '.$mailFrom;
$message = "
<head>
<title> $subject </title>
</head>
Benefits of an Automated Time Clock Solution - Landing Page
Name/Company name: $name
E-mail: $mailFrom
";
$message .= "Message:
$message_text
";
if (mail($mailTo, $subject, $message, $headers)) {
header("Location: http://www.google.com/");
} else {
echo "Some errors occurred, try again.";
}
}
?>
The email gets sent successfully but still no redirect.
I dont know if this helps but the contact form is an ajax contact form. The theme is called Kibou – Landing Page. It uses function.js to call the forms behaviour i guess?
Im tearing my hair out trying to figure this redirect issue out 
Well, there’s your problem.
Open functions.js,Find this:
//display the success text
result.find(".success").fadeIn();
Add after/before:
window.location.href = 'http://google.com';
YOU ARE A GENIOUS!
Thanks Hex!
