musings on Windows XP Media Center Edition RSS 2.0
# Monday, July 19, 2004

After installing Service Pack 2 ‘SV1’ is added to Internet Explorers HTTP User Agent, so should you want to display certain content only to SP2 users they can be filtered out as long as they use IE.

 

Here’s some sample PHP I have created to do this, which first looks for Windows XP, then Internet Explorer, then SV1. Transferring this to other languages should be pretty simple.

 

<?php

if (strstr($_SERVER["HTTP_USER_AGENT"], "Windows NT 5.1"))

{

            if(strstr($_SERVER["HTTP_USER_AGENT"],"MSIE")) {

                        if(strstr($_SERVER["HTTP_USER_AGENT"],"SV1"))

                        {

                        echo "Your system may have Windows XP Service Pack 2 installed";

                        }

                        else

                        {

                        echo "Your system was identified as a Windows XP system using Microsoft Internet Explorer that does not currently have Service Pack 2 installed. Service Pack 2 is an important update which can greatly increase the security of your system, please see http://www.microsoft.com/windowsxp/sp2 for more details.";

                        }

}

else

{echo "Sorry we cannot accurately tell which Service Pack is currently installed due to the limited information disclosed by your browser. This is the expected result if you are not using Microsoft Internet Explorer to view this page.";

}

}

else

{echo "This page is designed for use only with Microsoft Windows XP and Microsoft Internet Explorer";

}

?>

Although not an entirly fool proof solution, its good to have an idea without installing components on the visiting machine.

http://mvps.org/marksxp/WindowsXP/sp2detect.php

 

Monday, July 19, 2004 7:56:25 AM (GMT Daylight Time, UTC+01:00)  #    -
Windows XP SP2
Archive
<July 2004>
SunMonTueWedThuFriSat
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Mark Salloway
Sign In
Statistics
Total Posts: 91
This Year: 0
This Month: 0
This Week: 0
Comments: 3
Themes
All Content © 2010, Mark Salloway
DasBlog theme 'Business' created by Christoph De Baene (delarou)