Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2006
    Location
    Athens
    Posts
    842
    Tokens
    0

    Default Get User Browser [+rep]

    I am creating a script so that if your internet browser is IE it displays a message.

    Is there any other way to grap someones browser name other than
    Code:
    $_SERVER['HTTP_USER_AGENT']
    As that doesn't just display the Browser it displays other Info which is useless to me.
    Thanks
    Ashley

    Edited by Lµke (Forum Moderator): Thread Moved from Website Designing. Please post in the correct section next time, Thanks .
    Last edited by Lµke; 09-05-2007 at 07:57 PM.


  2. #2
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    Use eregi

    PHP Code:
    $agent $_SERVER['HTTP_USER_AGENT']; /* Users browser information */

    /* Shows browser name in Layman's terms */

    if (eregi("firefox"$agent)){
    $browser "Firefox";
    }
    elseif (
    eregi("MSIE"$agent)){
    $browser "IE";
    }
    elseif (
    eregi("opera"$agent)){
    $browser "Opera";
    }
    else {
    $browser "Unknown";
    }

    print(
    "You are using $browser"); 

  3. #3
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    I've always wondered, whats the difference between eregi and preg?

  4. #4
    Join Date
    Jul 2006
    Location
    Athens
    Posts
    842
    Tokens
    0

    Default

    Quote Originally Posted by Luckyrare View Post
    Use eregi

    PHP Code:
    $agent $_SERVER['HTTP_USER_AGENT']; /* Users browser information */

    /* Shows browser name in Layman's terms */

    if (eregi("firefox"$agent)){
    $browser "Firefox";
    }
    elseif (
    eregi("MSIE"$agent)){
    $browser "IE";
    }
    elseif (
    eregi("opera"$agent)){
    $browser "Opera";
    }
    else {
    $browser "Unknown";
    }

    print(
    "You are using $browser"); 
    Thanks +rep
    Edit: Need To spread


  5. #5
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    No problem

    Quote Originally Posted by Invent View Post
    I've always wondered, whats the difference between eregi and preg?
    Not to sure, I think preg handles arrays differently. I am most likely wrong.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •