Copy link to clipboard
Copied
***Originaly posted in Dreamweaver by mistake***
Hi guys,
I'm new to web design but doing ok. However I have come across a problem I can't resolve.
I've created a form using PHP script for extraction and it's all working fine except for one aspect.
All the info is being gathered and sent to the mailbox but I cannot get the 'thank you' page to appear. I keep gettng an error 500 page insread.
Anyone got any solutions? The code is as follows:
<?php
$ToEmail = 'info@jenniescandles.net';
$EmailSubject = 'Contact form ';
$mailheader .= "From: ".$_POST["contactEmail"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["contactEmail"]."\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
$MESSAGE_BODY .= "Name: ".$_POST["contactName"]."<br>";
$MESSAGE_BODY .= "Email address: ".$_POST["contactEmail"]."<br>";
$MESSAGE_BODY .= "Telephone: ".$_POST["contactTelephone"]."<br>";
$MESSAGE_BODY .= "Subject: ".$_POST["contactSubject"]."<br>";
$MESSAGE_BODY .= "Message: ".nl2br($_POST["contactMessage"])."<br>";
$sent = mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader);
if($sent)
{header( "Location: http://www.jenniescandles.net/messagesent.html" );}
else
{print "We encountered an error sending your comment"; }
?>
Copy link to clipboard
Copied
Why do you have a hidden field in your contact.html form with the redirection to the success page?. You should remove that one.
Copy link to clipboard
Copied
Thanks. Removed it but no difference. Still geting error 500.