title: PHP if value is null, send email
body: <p>I have a PHP script handling a form, but I want to send a specific confirmation email if the user has entered any info for a specific set of fields (<code>referral_1</code>, <code>referral_2</code>, etc.)</p>
  
  <p>Right now I have this to check if the user entered any info in the referral fields (text inputs):</p>
  
  <pre><code>if($referral_1 or $referral_2 or $referral_3 or $referral_4 or $referral_5 == null) {
      $autosubject = stripslashes($autosubject);
      $automessage = stripslashes($automessage);
      mail($email,"$autosubject","$automessage","From: $recipientname &lt;$recipientemail&gt;");
  }
  
  if($referral_1 or $referral_2 or $referral_3 or $referral_4 or $referral_5 != null) {
      $autosubject = stripslashes($autosubject);
      $automessage = stripslashes($automessage);
      mail($email,"$autosubject2","$automessage2","From: $recipientname &lt;$recipientemail&gt;");
  }
  </code></pre>
  
  <p>But it's sending both emails when the user completes the referral fields. When they do not enter any referral info, it seems to work just fine (they only get the specified confirmation email). Any idea what I'm doing wrong?</p>