Hi folks, I have a vBulletin forum and I want to display the browser and operating system in a widget at the side. This would only be displayed to the person viewing the forum, each member would see their own config. Does anyone know how I can achieve this please? Thanks!
You can use the $_SERVER['HTTP_USER_AGENT'] variable in PHP to get the info. apptools.com/phptools/browser/source.php (sorry, can't post links yet) See that website if you want to see a good example. You can see, actually getting the browser info is easy, formatting it in a meaningful way is tedious.
<?php echo $_SERVER['HTTP_USER_AGENT']; ?> PHP: or <?php if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) { echo 'Gutted - you use Internet Explorer.'; } ?> PHP: for if you want to whack it into a user-friendly version... Obviously you can have a play around with defining multiple browsers on the second one..
you can make this only with simple JavaScript code, can query Google for this, or you can use these scripts: - Browser Information script - Browser Information
There should be no "gutted" - there are only 2 types of match operator : != and == .. what !== means ?