title: Form action attribute not working properly
body: <p>I wrote a simple php script for a form, tested it out, and worked as expected. But when I actually added the script into the original project that I am working on, it suddenly stopped working? I am sure it has nothing to do with the php script as for it worked properly when I tested it; so basically what I am thinking about is that I probably wrote the action attribute wrong? I am pretty sure it is a rookie mistake. Eventually, I am really new to php.</p>
  
  <p>Regards.</p>
  
  <p><strong>HTML code:</strong></p>
  
  <pre><code>&lt;div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"&gt;
      &lt;div class="modal-dialog" role="document"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="modal-header"&gt;
                 &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;
                 &lt;h4 class="modal-title" id="exampleModalLabel"&gt;New message&lt;/h4&gt;
              &lt;/div&gt;
  
              &lt;div class="modal-body"&gt;
                 &lt;form action="contact.html" method="post"&gt;
                  &lt;div class="form-group"&gt;
                    &lt;label name="email" class="control-label"&gt;Email:&lt;/label&gt;
                    &lt;input type="text" class="form-control" id="recipient-name"&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group"&gt;
                      &lt;label name="phone" class="control-label"&gt;Phone:&lt;/label&gt;
                          &lt;input type="text" class="form-control" id="recipient-mobile"&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group"&gt;
                     &lt;label name="message" class="control-label"&gt;Message:&lt;/label&gt;
                     &lt;textarea class="form-control img-responsive" rows="5" id="messageText"&gt;&lt;/textarea&gt;
                  &lt;/div&gt;
                 &lt;/form&gt;
              &lt;/div&gt;
  
              &lt;div class="modal-footer"&gt;
                 &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
                 &lt;button type="button" id="resetText" class="btn btn-default"&gt;Reset&lt;/button&gt;
                 &lt;input type="button" value="Send message" name="send" class="btn btn-danger colorbg"/&gt;
                &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>PHP Code:</strong></p>
  
  <pre><code>&lt;?php
  if(isset($_POST['send'])){
  
      $to = 'domain@mail.com';
      $subject = 'Solutions';
      $mail = $_POST['email'];
      $phone = $_POST['phone'];
      $message = $_POST['message'];
      $mailHeader = "From: $mail \r\n Phone: $phone";
      $formcontent="Message: $message";
  
      if (!filter_var($mail, FILTER_VALIDATE_EMAIL)) {
          echo "&lt;script language='javascript'&gt;
                  alert('E-mail address is not valid');
                  var email = document.getElementById('recipient-name');
                  email.className += ' border-red';
                &lt;/script&gt;";
      } else {
        echo "&lt;script language='javascript'&gt;
                var email = document.getElementById('recipient-name');
                email.className = '';
                email.className += ' form-control';
              &lt;/script&gt;";
  
        if (mail($to , $subject, $formcontent, $mailHeader)) {
  
          echo "&lt;script&gt;
          window.setTimeout(function () {
              window.location.href = 'test.html';
          }, 3000);
          &lt;/script&gt;";
  
        } else {
          echo "&lt;script language='javascript'&gt;alert('There was an error. Please try again.')&lt;/script&gt;";
        }
    }
  }
  ?&gt;
  </code></pre>
  
  <p>Please note that I uploaded the project on my website in order to actually test the script so the link is something like this: website.com/project/index.html. And I changed the action to <code>action="script/contact.php"</code>, <code>action="./script/contact.php</code>, <code>action="contact.php"</code> none worked.</p>