title: }Else{ statement not reading boolean?
body: <p>So I've been working with php again, and I've set a variable to false, however, no matter what I do, when it gets to the IF statement, it echos the TRUE version when it should be echoing the FALSE version.</p>
  
  <pre><code>    $loginauth= $_POST['loginauth'];
      $errormain = false; // I've clearly set $errormain to false
  
  if(!empty($loginauth)){
      if(!empty($username)){
          if(!empty($pass)){
  
          }else{$errormain = false;}// In an effort to fix this issue, I've set each one 
          }else{$errormain = true;}// of these $errormain = true; statements to false
          }else{$errormain = true;}// systematically one by one, yet somehow it still echos as if it was true.
  
    if($errormain = true){
        $errormain1 = "&lt;h1&gt;Error&lt;/h1&gt;&lt;em&gt;Login Failed&lt;/em&gt;";
    }else{
        $errormain1 = "&lt;h1&gt;Welcome&lt;/h1&gt;&lt;em&gt;BadgesCoding.com&lt;/em&gt;";
    } 
  </code></pre>