title: Javascript inside PHP browser detection
body: <p>Can anyone tell me why I keep getting the <code>else</code> and <code>alert</code> is not being triggered at all? The cookie is being set just while the browser is open.</p>
  
  <pre><code>&lt;?php
  $setcookie = setcookie('version', 'nova');
  $browser = get_browser(null, true);
      if(!isset($setcookie)){
          if($browser["MSIE"] &lt; 8.0){
          // display message or alert!
  
                 echo "&lt;script language=\"JavaScript\"&gt;\n"; 
                 echo 'alert("Please upgrade to version 8.0+ in order to view this site.");';
                 echo "&lt;/script&gt;";
          }
         }
  
          else
  
          {
              echo "Browser is current:";
          }
  
  ?&gt;
  </code></pre>