whats up people?
I could use some advice on this error message I get returned.
I followed a tutorial here on Kirupa on a contact form in php.
I’ve been banging on it and have had no luck, any advice would be great.
Be gentle with me, I’m new to backend development fun.
P.s been lurking on here for a little while now and have already learned a great deal, Kirupa rox!
Thankx!
D
return:
Error 405 Method Not Allowed
The requested method POST is not allowed for URL /mailer.php
php code:
<?php
if(isset($_POST[‘submit’])) {
$to = "dope@dope.com";
$subject = "Form Tutorial";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];
$option = $_POST['radio'];
$dropdown = $_POST['drop_down'];
foreach($_POST['check'] as $value) {
$check_msg .= "Checked: $value
";
}
$body = "From: $name_field
E-Mail: $email_field
$check_msg Option: $option
Drop-Down: $dropdown
Message:
$message
";
echo "Data has been submitted to $to!";
mail($to, $subject, $body);
} else {
echo “blarg!”;
}
?>