Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , , ,

Sponsored Links



How To Detect Browser Type With Php

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 21-11-2009
Member
 
Join Date: Apr 2009
Posts: 87
How To Detect Browser Type With Php

I am looking for code in php to detect browser. The main purpose of this code is to find the browser type used by the visitors when they visit website. Is that possible in php?
Reply With Quote
  #2  
Old 21-11-2009
Zecho's Avatar
Member
 
Join Date: May 2008
Posts: 2,267
Re: How To Detect Browser Type With Php

Detecting the user’s browser type and version is helpful in web applications which give the idea to developer for new concepts. Some browsers allow the user to alter the way the browser identifies itself, or to not identify itself at all. With the browser type and version you can notify users about challenges they may experience and suggest they upgrade before using such application.Some firewalls block the sending of the browser identification, so no browser detection scheme is entirely successful.
Reply With Quote
  #3  
Old 21-11-2009
Member
 
Join Date: Jan 2009
Posts: 199
Re: How To Detect Browser Type With Php

you could also use something like this:
Code:
<pre><?php 
echo ( browser_detection( 'number' ) .'<br>'. 
bro_det( 'bro' ) .'<br>'. 
bro_det( 'os' ) .'<br>'. 
bro_det( 'os_num' ) ); 
?> 

outputs (browser version, browser, os, os number): 
y.4 
moz 
nt 
4.y ( ( browser_detection( 'bro' ) == 'ie' ) 
&& 
( browser_detection( 'num' ) >= 4 ) ) 
{ 
echo 'it is Mozilla firefox ' . 
browser_detection( 'num' ); 
} 
?> 
</pre>
Reply With Quote
  #4  
Old 21-11-2009
Member
 
Join Date: Dec 2008
Posts: 177
Re: How To Detect Browser Type With Php

Code:
<?php
$br = strtolower($_SERVER['HTTP_USER_AGENT']); 
if(ereg("msie", $br)) {
header("location: origpage.php");
} else {
header("location: alterpage.php");
}
?>
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How To Detect Browser Type With Php"
Thread Thread Starter Forum Replies Last Post
Content Type | Mime Type for Office 2010 file format and extension ramsun Tips & Tweaks 1 16-08-2010 06:25 PM
Content Type | Mime Type for Office 2007 file format and extension D_chapple Tips & Tweaks 1 16-08-2010 05:44 PM
Change a 64-bit browser to a 32-bit browser, or adding a 32-bit browser alongside the 64-bit browser Chen Technology & Internet 5 31-07-2010 01:25 PM
Detect browser if Ie (internet explorer) then run script? X-riskS Software Development 4 10-07-2009 10:57 PM
PlanPlus for Outlook v4.1_3237 - HR[80070057] - Variant type 8 incompatible with match MAPI type 64 mobi MS Office Support 2 01-09-2007 03:43 AM


All times are GMT +5.5. The time now is 11:20 AM.