title: Contact form submission
body: <p>I am new to php - I am trying to make a simple contact form submission with a template code provided. I get this error reporting:</p>
  
  <p>Fatal error: Uncaught Error: Function name must be a string in /home/u512372001/domains/thestripedphoenix.com/public_html/assets/php/mail.php:15 Stack trace: #0 {main} thrown in /home/u512372001/domains/thestripedphoenix.com/public_html/assets/php/mail.php on line 15</p>
  
  <p>What went wrong with the php?</p>
  
  <p>Here is the HTML Form code:</p>
  
  <pre class="lang-html prettyprint-override"><code>                                    &lt;form method="POST" action="assets/php/mail.php"&gt;
  
                                          &lt;div class="row gtr-uniform"&gt;
                                              &lt;div class="col-6 col-12-xsmall"&gt;
                                                  &lt;input type="text" name="name" id="name" value="" placeholder="Name" /&gt;
                                              &lt;/div&gt;
                                              &lt;div class="col-6 col-12-xsmall"&gt;
                                                  &lt;input type="email" name="email" id="email" value="" placeholder="Email" /&gt;
                                              &lt;/div&gt;
                                              &lt;div class="col-12"&gt;
                                                  &lt;select name="category" id="category"&gt;
                                                      &lt;option value=""&gt;I want a . . .&lt;/option&gt;
                                                      &lt;option value="1"&gt;Logo&lt;/option&gt;
                                                      &lt;option value="1"&gt;Website&lt;/option&gt;
                                                      &lt;option value="1"&gt;Polished Document&lt;/option&gt;
                                                      &lt;option value="1"&gt;Promotional Material&lt;/option&gt;
                                                  &lt;/select&gt;
                                              &lt;/div&gt;
                                              &lt;div class="col-4 col-12-small"&gt;
                                                  &lt;input type="radio" id="priority-low" name="priority" checked&gt;
                                                  &lt;label for="priority-low"&gt;Low&lt;/label&gt;
                                              &lt;/div&gt;
                                              &lt;div class="col-4 col-12-small"&gt;
                                                  &lt;input type="radio" id="priority-normal" name="priority"&gt;
                                                  &lt;label for="priority-normal"&gt;Normal&lt;/label&gt;
                                              &lt;/div&gt;
                                              &lt;div class="col-4 col-12-small"&gt;
                                                  &lt;input type="radio" id="priority-high" name="priority"&gt;
                                                  &lt;label for="priority-high"&gt;High&lt;/label&gt;
                                              &lt;/div&gt;
                                              &lt;div class="col-12"&gt;
                                                  &lt;textarea name="message" id="message" placeholder="Enter your message" rows="6"&gt;&lt;/textarea&gt;
                                              &lt;/div&gt;
                                              &lt;p&gt;
                                              This site is protected by reCAPTCHA and the Google
                                              &lt;a href="https://policies.google.com/privacy"&gt;Privacy Policy&lt;/a&gt; and
                                              &lt;a href="https://policies.google.com/terms"&gt;Terms of Service&lt;/a&gt; apply.                                         &lt;/p&gt;
                                              &lt;div class="col-12"&gt;
                                                  &lt;ul class="actions"&gt;
                                                      &lt;li&gt;&lt;input name="submit" name="submit" value="Send Message" class="primary" /&gt;&lt;/li&gt;
                                                      &lt;li&gt;&lt;input type="reset" value="Reset" /&gt;&lt;/li&gt;
                                                  &lt;/ul&gt;
                                              &lt;/div&gt;
                                          &lt;/div&gt;
                                      &lt;/form&gt;
  </code></pre>
  
  <p>The php code for the form submission:</p>
  
  <pre><code>&lt;?php
  
  error_reporting(E_ALL);
  ini_set('display_errors', 1);
  
  
  
  if(isset($_POST['submit'])) {
  $to = "mymail@gmail.com";
  $subject = "Subject Line";
  
          # Sender Data
          $name = str_replace(array("\r","\n"),array(" "," ") , strip_tags(trim($_POST["name"])));
          $email = filter_var(trim($_POST["email"]), FILTER_SANITIZE_EMAIL);
          $category = $_POST(["category"]);
          $priority = $_POST(["priority"]);
          $message = trim($_POST["message"]);
  
          if ( empty($name) OR !filter_var($email, FILTER_VALIDATE_EMAIL) OR empty($message) OR empty($category)) {
              # Set a 400 (bad request) response code and exit.
              http_response_code(400);
              echo '&lt;p class="alert alert-warning"&gt;Please complete the form and try again.&lt;/p&gt;';
              exit;
          }
  
              # Mail Content
              $content = "Name: $name\r\n";
              $content .= "Email: $email\n\n";
              $content .= "I want a: $category\n\n";
              $content .= "Priority: $priority\n\n";
              $content .= "Message: $message\n\n";
  
  
              # Send the email.
              mail($to, $subject, $content);
              if ($success) {
                  # Set a 200 (okay) response code.
                  http_response_code(200);
                  echo '&lt;p class="alert alert-success"&gt;Thank You! Your message has been sent.&lt;/p&gt;';
              } else {
                  # Set a 500 (internal server error) response code.
                  http_response_code(500);
                  echo '&lt;p class="alert alert-warning"&gt;Oops! Something went wrong, we couldnt send your message.&lt;/p&gt;';
              }
  
  
      } else {
          # Not a POST request, set a 403 (forbidden) response code.
          http_response_code(403);
          echo '&lt;p class="alert alert-warning"&gt;There was a problem with your submission, please try again.&lt;/p&gt;';
      }
  
  
  
  ?&gt;
  
  </code></pre>
  
  <p>From the php form, if the user didn't fill out the form entirely, then there will be a validation error message. Once submitting all the required information, the message should go to my email.</p>
  
  <p>Please let me know if you need further clarification. Thanks for your help!</p>