0

I'm trying to create an anonymous submission form on my website page, https://pomegranate-society.com/anon.html. I have a text box ready, but whenever I try to test it, I receive an error: "405 Not Allowed". I was wondering if someone could look at my code and help me out? I only have PHP installed on my computer but I am not sure what I should do in order to fix this problem. The complete repository for this website is at https://github.com/shilpakancharla/pomegranate-society.com/tree/gh-pages. Thanks everyone in advance.

I've tried using <?php instead of <?.

<?php
$webmaster_email = "societypomegranate@gmail.com";

$feedback_page = "anon.html";

$feedback_page = "anon.html";
$error_page = "error_message.html";
$thankyou_page = "thank_you.html";


$comments = $_REQUEST['comments'] ;
$msg = 
"Anonymous Submission: " . $comments ;


if (!isset($_REQUEST['email_address'])) {
header( "Location: $feedback_page" );
}

elseif (empty($comments)) {
header( "Location: $error_page" );
}

else {

    mail( "$webmaster_email", "Anonymous Form Results", $msg );

    header( "Location: $thankyou_page" );
}
?>

I hope that this form works, and an email can be sent to societypomegranate@gmail.com.

user10335564
  • 133
  • 3
  • 16
  • Does this work on your computer? – Sam Dec 28 '18 at 04:05
  • No, it unfortunately, doesn't. It just shows me the code instead of a thank you or an error page. – user10335564 Dec 28 '18 at 04:13
  • Have you tried it on a localhost webserver? –  Dec 28 '18 at 04:27
  • Start by turning on your error reporting: `ini_set('display_errors', 1);error_reporting(-1);` at the top of your script. Also, do you have a web stack installed (*i.e. WAMP, LAMP, XAMPP, etc*) as it might potentially be your `mail( )` call causing the error... – Darren Dec 28 '18 at 04:43

0 Answers0