PHP联系表单问题(红色边框验证)

I have been searching the web for two days for some sort of PHP template (because I do not know how to code in PHP) that could highlight a borders red if the user did not enter all the proper information. I manage to get the contact form working but not the way I want. Essentially, I need the user to enter proper information; if not, a red border appears.

Current Situation: [Basic Contact Form: No Validation]

Desired Situation: [Validating Contact Form] *

  1. Name (Required)(If Error: Red Border)
  2. Email (Required: At least including the @ sign)(If Error: Red Border)
  3. Subject (Required)(If Error: Red Border)
  4. Message (Required)(If Error: Red Border)

*

My site is: www.haildark.com, if you want to see it in its full detail. Please help if you can. I think my brain is about to implode again. Thank you. It does not have to be in PHP. As long as the code gets the job done, its perfectly fine with me.

HTML:

<!-- Contact -->
<div class="wrapper wrapper-style5">
  <article id="contact" class="container small">
    <header>
      <h2>
        Contact Us
      </h2>
      <span>
        If you have any questions, comments, or concerns, please contact below and we will respond as soon as we can.
        Please allow us at least 72 hours to respond. Thanks for supporting us.
      </span>
    </header>
    <div>
      <div class="row">
        <div class="12u">
          <form method="post" action="contact.php">
            <div>
              <div class="row half">
                <div class="6u">
                  <input type="text" name="name" id="name" placeholder="Name" />
                </div>
                <div class="6u">
                  <input type="text" name="email" id="email" placeholder="Email" />
                </div>
              </div>
              <div class="row half">
                <div class="12u">
                  <input type="text" name="subject" id="subject" placeholder="Subject" />
                </div>
              </div>
              <div class="row half">
                <div class="12u">
                  <textarea name="message" id="message" placeholder="Message">
                  </textarea>
                </div>
              </div>
              <div class="row">
                <div class="12u">
                  <a href="#" class="button form-button-submit">
                    Send Message
                  </a>
                  <a href="#" class="button button-alt form-button-reset">
                    Clear Form
                  </a>
                </div>
              </div>
            </div>
          </form>
        </div>
      </div>

Basic PHP:

<?php
$field_name = $_POST['name'];
$field_email = $_POST['email'];
$field_subject = $_POST['subject'];
$field_message = $_POST['message'];

$mail_to = 'info@domain.com';
$subject = 'HailDark® User: '.$field_subject." - ".$field_name;

$body_message = 'From: '.$field_name."
";
$body_message .= 'E-mail: '.$field_email."
";
$body_message .= 'Subject: '.$field_subject."
";
$body_message .= 'Message: '.$field_message;

$headers = 'From: '.$field_email."
";
$headers = 'Reply To: '.$field_email."
";

$mail_status = mail($mail_to, $subject, $body_message, $headers);

if ($mail_status) { ?>
    <script language="javascript" type="text/javascript">
        alert('Thank you for the message. We will contact you shortly.');
        window.location = 'index.html';
    </script>
<?php
}
else { ?>
    <script language="javascript" type="text/javascript">
        alert('Message failed. Please, send an email to info@domain.com');
        window.location = 'index.html';
    </script>
<?php
}
?>
<?php
if(empty($_POST['test'])) // other validation
{
    $error = true;
}
?>


<input type="text" name='test' class='<?php echo ($error)?"red-border":"green-border"; ?>' />
<input type='submit' value='send' />

<style type="text/css">
    .red-border{
        border: 1px solid red;
    }
    .green-border{
        border: 1px solid green;
    }
</style>
I have seen that you are using HTML5 but not completely.You used <input type="text" name="email" id="email" placeholder="Email" />

You can use <input type="email" name="email" id="email" placeholder="Email" required="required"/>

Html5 provides powerful way to manage your site like as the above line I used type="email" it automatically validation for email and also required="required" attribute provides you this field must not be empty it will highlighted you.
So use at first <!DOCTYPE html>before <html> tag and use html5 tags and use required="required" attribute for every tag where you want to validate the field.