title: Javascript Pop Up box on if statement
body: <p>My code is as follows:</p>
  
  <pre><code>//Input Validations 
  $result = mysql_query("SELECT * FROM members WHERE `email` = '$insp_email' LIMIT 1" ); 
  $exist = mysql_fetch_row($result); 
      if ($exist !==false ) { 
         $errmsg_arr[] = 'That Email is already registered.';
         $errflag = true;
         }
  $result = mysql_query("SELECT * FROM members WHERE `login` = '$user_name' LIMIT 1" ); 
  $exist = mysql_fetch_row($result); 
      if ($exist !==false ) { 
         $errmsg_arr[] = 'That Username is already registered.';
         $errflag = true;
         }
  
  //If there are input validations, redirect back to the registration form
  if($errflag) {
      $_SESSION['ERRMSG_ARR'] = $errmsg_arr;
              $_SESSION['ERROR'] = 'Yes';
      session_write_close();
      header("location: accountinfo.php");
      exit();
  }
  </code></pre>
  
  <p>If there are any input validations from the registration page, the user will be directed back to the registration page.  What I want to do is when they are redirected back, $_SESSION['ERROR'] will = True.  When and only when that is = True, do I want a popup box to display a error message.  I the code for the popup message. I just can't figure out how to get it to load only on the if $_SESSION['ERROR'] == 'True'</p>
  
  <pre><code>&lt;script language="javascript"&gt;
  alert('&lt;?= $s ?&gt;')
  &lt;/script&gt;
  </code></pre>
  
  <p>That code will display a message with a php variable.  I need help getting the message to display only when the $_SESSION['ERROR'] equals 'True'</p>
  
  <p>Thank you!</p>