title: PHP empty fields not working
body: <p>Can anyone find any errors in this script because I can still submit blank forms. The PHP empty() function also isn't working. I've tried double checking, triple checking and I can't find no simple explanation. I am working in a local environment using XAMPP. Any advice?</p>
  
  <pre><code>&lt;?php
  include('core/includes/startsite.inc.php');
  if(isset($_POST['submit'])){
  $con = new mysqli("localhost", "root", "salvation", "dcstocksolutions");
  $name = $_POST['name'];
  $comment = $_POST['comment'];
  if($name == "" || $comment == ""){
      $msg = "Sorry, you missed out a field.";
  }
  $q = "INSERT INTO testimonials ('name', 'comment') VALUES ('$name', '$comment')";
  
  if($con-&gt;query($q)){
      $_SESSION['msg'] = "Thank you! Your review was submitted.";
      header("Location: testimonials?r=1");
  } else {
      $msg = "Sorry, there was an error submitting your review, please try again later.";
  }
  }
  ?&gt;
  &lt;div class="testimonial-container"&gt;
  &lt;h3 align="center"&gt;Leave a review&lt;/h3&gt;&lt;br /&gt;
      &lt;?php
          if(isset($msg)){
              echo("&lt;p align=\"center\"&gt;" . $msg . "&lt;/p&gt;");
          }
      ?&gt;
      &lt;form action="review" method="POST" autocomplete="off"&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;Full Name:&lt;/td&gt;
                  &lt;td&gt;&lt;input type="text" name="name" placeholder="Full Name" value=""&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;Comment:&lt;/td&gt;
                  &lt;td&gt;&lt;textarea name="comment"&gt;&lt;/textarea&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                  &lt;td&gt;&lt;input type="submit" name="submit" value="Submit Review"&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  &lt;?php
  include('core/includes/endsite.inc.php');
  ?&gt;
  </code></pre>