title: PHPmailer, if mail script is visited directly an empty email sends from root
body: <p>I have an email form with an action of mail.php. If mail.php is visited directly it send an email with blank information. I only want this script to execute if it is referred to by the contact page.</p>
  
  <p>index.html has the contact form. Action is set to /assets/php/mail.php.</p>
  
  <p>Nginx denies access to the directory and mail.php is chmod 500.</p>
  
  <p>What is the best way to resolve this? If post data nulled exit? Something along those lines?</p>