0

I'm very new to php, so apologies if I'm missing something very basic here.

My simple form, which is supposed to Post to email, gets interpreted as a Get request with either a 304 or 500 code.

Here is the relevant form code currently:

<form name="customerreqform" action="/processingscript.php/" method="post"> 
\\ form stuff
<input type="submit" value="Submit" method="post" action="/processingscript.php/">

I am using some validation script with if ($SERVER[$_"POST"]) on the same page.

This is the processing script (fname, etc., are the form input names):

<?php
if($_POST["Submit"]) {
mail("email@email.com", "Form to email message", $_POST["fname", "lname", "email", "document", "comments"], "From: an@email.address");
}
?>

When I try to input data to the form, the page just reloads, and nothing gets sent.

I've enabled php and have attempted to confirm the mail settings in php.ini, but I don't have access.

Thanks in advance.

  • `/processingscript.php/` < that should throw you an error. There shouldn't be an ending slash. – Funk Forty Niner Apr 24 '20 at 19:33
  • Only `
    ` has an action/method, not ``. Plus, your submit will not work, since there is no input matching input for `if($_POST["Submit"])`.
    – Funk Forty Niner Apr 24 '20 at 19:34
  • And turn on error logging. ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); – Markus Müller Apr 24 '20 at 19:37
  • Thanks, @FunkFortyNiner. I appreciate the comment even though my question isn't original. I wonder if you could explain what you mean by "input matching input" in your comment. In the form code there are 5 text inputs before the submit. Aren't those the input that gets submitted when the user clicks submit? Thanks. – michael robinson May 04 '20 at 17:33

0 Answers0