Announcement

Collapse
No announcement yet.

Browser

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Browser

    I need to detect the browser of the visitors...

    I have in phpinclude

    Code:
    ob_start();
     require("includes/useragent.php");
     $explorer = ob_get_contents();
     ob_end_clean();
    And in the useragent.php

    Code:
    <?
     
      if (preg_match("/MSIE/i", "$HTTP_USER_AGENT")) {  
     	 echo "true";
      }else{
     	 echo "false";
      }
     
      ?>
    But it doesnĀ“t work.

    Is it possible to detect the MSIE in the variable $userinfo[useragent]?

    Sincerely thanks.

  • #2
    First of all which version of PHP are you on?
    I don't think the earlier versions of PHP read $HTTP_USER_AGENT...you might have to use $_SERVER['HTTP_USER_AGENT'] instead.

    What useragent.php is doing is matching the user agent against a regular expression...it would be faster if you used get_browser() (read up on installing browscap).
    If you want to use regular expressions, just give me the exact URL you want to detect and I will write the regular expression for you
    <@Bane>Go on baby, be kinky and talk to me in PHP.

    I recommend MBSHost to all my clients
    PHP scripts I'm working on
    My favourite search engine

    Comment


    • #3
      You are currently showing up as unlicensed. To be able to receive support here at vBulletin.com, we ask you to please click HERE and enter your email address, to show us that you are licensed.

      You will need to use your customer number and password (which will be in the email you got when you paid for your license) to access that page. Please note that your email is case sensitive.

      Thank you.

      Comment


      • #4
        Originally posted by Zachery
        You are currently showing up as unlicensed. To be able to receive support here at vBulletin.com, we ask you to please click HERE and enter your email address, to show us that you are licensed.

        You will need to use your customer number and password (which will be in the email you got when you paid for your license) to access that page. Please note that your email is case sensitive.

        Thank you.

        Done

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...
        X