Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End help with php form email tutorial from css-tricks Re: help with php form email tutorial from css-tricks

#92348
phendyr
Member

I’ll give that a shot, even better, how would I make redirect to a confirmation page? I tried changing the echo to location: below – it still submits the form, just doesn’t do anything.


// CHANGE THE BELOW VARIABLES TO YOUR NEEDS

$to = '[email protected]';

$subject = 'Test form submission from form';

$headers = "From: " . $cleanedFrom . "rn";
$headers .= "Reply-To: ". strip_tags($_POST) . "rn";
$headers .= "MIME-Version: 1.0rn";
$headers .= "Content-Type: text/html; charset=ISO-8859-1rn";

if (mail($to, $subject, $message, $headers)) {
header("Location: thank-you.html");
} else {
echo 'There was a problem sending the email.';
}

// DON'T BOTHER CONTINUING TO THE HTML...
die();