title: Notice: Undefined index: submit in (Path)
body: <p>Hey StackOverflow Community, i have a problem with my Contact Form.</p>
  
  <p>I used this PHP Script:</p>
  
  <pre><code>&lt;?php
      if ($_POST["submit"]) {
          $name = $_POST['name'];
          $email = $_POST['phone'];
          $email = $_POST['email'];
          $message = $_POST['message'];
          $human = intval($_POST['human']);
          $from = 'Kontaktformular'; 
          $to = 'email@mail.com'; 
          $subject = 'Buchungsanfrage - $name';
  
          $body ="From: $name\n: $phone\n E-Mail: $email\n Message:\n $message";
  
          // Check if name has been entered
          if (!$_POST['name']) {
              $errName = 'Bitte geben Sie den Namen ein.';
          }
  
          // Check if email has been entered and is valid
          if (!$_POST['email'] || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
              $errEmail = 'Bitte geben Sie eine gültige E-Mail Adresse ein.';
          }
  
          //Check if message has been entered
          if (!$_POST['message']) {
              $errMessage = 'Bitte hinterlassen Sie mir eine Nachricht.';
          }
          //Check if simple anti-bot test is correct
          if ($human !== 5) {
              $errHuman = 'Ihre Anti-Span Antwort war falsch.';
          }
  
  // If there are no errors, send the email
  if (!$errName &amp;&amp; !$errEmail &amp;&amp; !$errMessage &amp;&amp; !$errHuman) {
      if (mail ($to, $subject, $body, $from)) {
          $result='&lt;div class="alert alert-success"&gt;Danke! Ich werde mich schnellstmöglich bei Ihnen melden.&lt;/div&gt;';
      } else {
          $result='&lt;div class="alert alert-danger"&gt;Entschuldigung, beim versenden Ihrer Nachricht ist etwas schief gelaufen. Bitte versuchen Sie es nochmal.&lt;/div&gt;';
      }
  }
      }
  ?&gt;
  </code></pre>
  
  <p>And this HTML for my Form:</p>
  
  <pre><code>&lt;div class="block block-primary-head no-pad"&gt;
              &lt;h3&gt;&lt;i class="fa fa-pencil"&gt;&lt;/i&gt; Buchungsanfrage&lt;/h3&gt;
              &lt;div class="block-content"&gt;
                  &lt;form role="form" method="post" action="fotografie.php"&gt;
              &lt;div class="form-group"&gt;
                  &lt;label&gt;Name*&lt;/label&gt;
                  &lt;input type="text" class="form-control" id="name" name="name" placeholder="Vor- und Nachname" value="&lt;?php echo htmlspecialchars($_POST['name']); ?&gt;"&gt;
                  &lt;?php echo "&lt;p class='text-danger'&gt;$errName&lt;/p&gt;";?&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  &lt;label&gt;Telefonnummer&lt;/label&gt;
                  &lt;input type="text" class="form-control" id="phone" name="phone" placeholder="Ihre Telefonnummer" value="&lt;?php echo htmlspecialchars($_POST['phone']); ?&gt;"&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  &lt;label&gt;E-Mail Adresse&lt;/label&gt;
                  &lt;input type="email" class="form-control" id="email" name="email" placeholder="Ihre E-Mail Adresse" value="&lt;?php echo htmlspecialchars($_POST['email']); ?&gt;"&gt;
                  &lt;?php echo "&lt;p class='text-danger'&gt;$errEmail&lt;/p&gt;";?&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  &lt;label&gt;Nachricht&lt;/label&gt;
                  &lt;textarea class="form-control" id="message" name="message"&gt;&lt;?php echo htmlspecialchars($_POST['message']);?&gt;&lt;/textarea&gt;
                  &lt;?php echo "&lt;p class='text-danger'&gt;$errMessage&lt;/p&gt;";?&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  &lt;label&gt;2 + 3 = ?&lt;/label&gt;
                  &lt;input type="text" class="form-control" id="human" name="human" placeholder="Ihre Antwort"&gt;
                  &lt;?php echo "&lt;p class='text-danger'&gt;$errHuman&lt;/p&gt;";?&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
              &lt;?php echo $result; ?&gt;
          &lt;/div&gt;
          &lt;button type="submit" id="submit" name="submit" value="send" class="btn btn-primary"&gt;Absenden&lt;/button&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>But when i go on my side now, i got the following error:</p>
  
  <p>Notice: Undefined index: submit in ..\htdocs\projects\bootstrap-themes\001\contact\form-fotografie.php on line 2</p>
  
  <p>Line 2 is following code:</p>
  
  <p>if ($_POST["submit"]) {</p>
  
  <p>What could be the problem?</p>
  
  <p>Thanks for your help :-)</p>