February 1, 200818 yr Hey guys, new to the site (Hello!) Wondered if you could give me a few pointers in the right direction... I have been playing with this PHP contact form, but cant seem to get it working. Whenever I click submit it just shows the error page. I have removed all validation to eliminate that. Would any of you mind taking a quick look for me if you get chance? The form can be seen here and this is the PHP script I am using; <?php $EmailFrom = "Site Quote"; $EmailTo = "j.cresse@hgkcomputers.co.uk"; $Subject = "Price Quote"; // email body $Body = ""; $Body .= "Number of Pages Required: "; $Body .= $no_pages; $Body .= "\n"; $Body .= "Animation required?: "; $Body .= $animation; $Body .= "\n"; $Body .= "Animation Length: "; $Body .= $animationLength; $Body .= "\n"; $Body .= "Number of images required: "; $Body .= $pictures; $Body .= "\n"; $Body .= "Number of forms required: "; $Body .= $number_forms; $Body .= "\n"; $Body .= "Number of videos required: "; $Body .= $videos; $Body .= "\n"; $Body .= "Password pages required: "; $Body .= $password; $Body .= "\n"; $Body .= "Number of flash pages required: "; $Body .= $flash; $Body .= "\n"; $Body .= "eCommerce Required?: "; $Body .= $basket; $Body .= "\n"; $Body .= "Domain required: "; $Body .= $domain; $Body .= "\n"; $Body .= "Hosting required: "; $Body .= $hosting; $Body .= "\n"; $Body .= "Number of email addressed required: "; $Body .= $numberEmail; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=pricing_temp.html\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">"; } ?> This is my 1st attempted at coding in PHP, I've probably missed something so basic out (lol) so go easy on me! Thanks in advanced Jay
February 1, 200818 yr Author What error message do you get? Just goes straight to the error.html I use in the else statement, no actual error as such, and nothing gets to my inbox (or junk mail)
February 1, 200818 yr This means that the email is not being sent, and is usually caused by the fact you don't have a mail server installed!
February 1, 200818 yr Author This means that the email is not being sent, and is usually caused by the fact you don't have a mail server installed! Thanks mate, I need to check this with my host, I'm sure they would have something in place for such scripts... Apart from that does the coding look ok? Cheers
February 3, 200818 yr Looks ok. But I'd recommend that you use an HTTP header to redirect the user instead of the META refresh. More reliable.
Create an account or sign in to comment