Results 1 to 4 of 4

Thread: How To Detect Browser Type With Php

  1. #1
    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?

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    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.

  3. #3
    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>

  4. #4
    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");
    }
    ?>

Similar Threads

  1. Replies: 4
    Last Post: 02-01-2011, 12:25 AM
  2. Replies: 1
    Last Post: 16-08-2010, 05:25 PM
  3. Replies: 1
    Last Post: 16-08-2010, 04:44 PM
  4. Replies: 5
    Last Post: 31-07-2010, 12:25 PM
  5. Detect browser if Ie (internet explorer) then run script?
    By X-riskS in forum Software Development
    Replies: 4
    Last Post: 10-07-2009, 09:57 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,902,276.72230 seconds with 16 queries