Well, PHP will do that for you, in a way. You can use the $HTTP_USER_AGENT string to grab what type of browser they're using, and just use a little flow control to deduce which OS. There may very well be another method in PHP, but I don't know it (yet).
Here's a quick example I had worked up awhile back:
Code:
$HTTP_USER_AGENT and strstr() function call:
<?php
if (strstr($HTTP_USER_AGENT, "MSIE")) {
?>
<p align="left">You're using a Microsoft OS.</p>
<?
} else
if (strstr($HTTP_USER_AGENT, "Mozilla")) {
?>
<p align="left">You're using an opensource OS.</p>
<?
} print $HTTP_USER_AGENT;
?>