Launch a popup window for IE6 only

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
davemwohio
Forum Newbie
Posts: 1
Joined: Wed Nov 04, 2009 7:42 am

Launch a popup window for IE6 only

Post by davemwohio »

My company is using Drupal for an internal site. Drupal need IE6 to display the nav menu properly but many users still have IE6. We want to launch a popup urging users to upgrade their browser if IE6 is detected. I am running the below script in a block that appears on the home page only but there are still a couple people with IE7 (one of whom is a vice president) who get the popup and I can't understand why. Any input appreciated.

Code: Select all

<?
 
$file = "http://webapps.corp.stercomm.com/salescenter/sites/default/files/upload/ie6warning.htm";
 
$pos = strpos($_SERVER['HTTP_USER_AGENT'],"MSIE 6.0");
 
if ($pos === false)
{ 
}
else
{
 
?>
<script type="text/javascript">   
    function window.onload()   
    {   
        openpopup();   
    }   
    function openpopup()   
    {   
        winpops=window.open("<?=$file?>","","width=300,height=230");   
    }   
</script>   
<?
 
}
 
?>
Post Reply