Link to home
Start Free TrialLog in
Avatar of Sandy Sailer
Sandy SailerFlag for United States of America

asked on

PHP IE7 browser detection script

I'm looking for a PHP browser detection script.  If the user has IE7, I want to display a message on the page.  I have one that I'm playing with but it's not working correctly.  
Avatar of hielo
hielo
Flag of Wallis and Futuna image

try:
if( preg_match('#MSIE\s+7#',$_SERVER['USER_AGENT']) )
{
 echo "IE7";
}

Open in new window

Avatar of Sandy Sailer

ASKER

Sorry, it's not working.  I'm not getting an error, just no output message at all.  
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Actually, it's not working.  It works for version 8 only, but not 7 - it doesn't detect version 7 in I.E.  Any suggestions?