<html>
<head>
<script type="text/javascript">
function browser(){
	alert(navigator.appName);
}
</script>
</head>
<body align="center">
<?php
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) 
		echo 'Internet explorer';
 
elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== FALSE) 
		echo 'Mozilla Firefox';
 
elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== FALSE) 
			echo 'Google Chrome';
elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') !== FALSE) 
			echo 'Safari';
else 
			echo 'Something else';
?>
<hr width="80%" height="5">
<p><input type="button" value="test browser" onclick="browser()"/></p>
</body>
</html>