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!


Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default Anyone know the PHP for..

    Well basically im trying to do something so that if the word "Mozilla" appears anywhere in the browser, it will add extra content..

    But i have no idea how to code it so it will only look for the work mozilla, not the software as a whole if you know what i mean?

    I dont know if this will work
    PHP Code:
    <?
    $browser 
    $_SERVER['HTTP_USER_AGENT'];
    if(
    $browser==*Mozilla*)
    Echo(
    "BlaBlaBlaBlaBla");
    ?>
    Thanks for any help
    Coming and going...
    Highers are getting the better of me

  2. #2
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    Ok, mine doesnt work. Sorry
    Last edited by Blob; 25-07-2007 at 02:28 PM.

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

    Latest Awards:

    Default

    PHP Code:
    <?php

    if( preg_match"/mozilla/i"$_SERVER"HTTP_USER_AGENT"] ) )
    {

        echo 
    "Mozzila";

    }
    elseif ( 
    preg_match"/msie/i"$_SERVER"HTTP_USER_AGENT" ] ) )
    {

        echo 
    "Internet Explorer";

    }

    ?>

  4. #4
    Join Date
    May 2007
    Location
    Nebo, NC, USA
    Posts
    2,517
    Tokens
    0

    Latest Awards:

    Default

    mozilla not mozzila :p

  5. #5
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    Thanks Invent +REP to all of you if i dont have to spread..
    EDIT: Have to spread..
    Coming and going...
    Highers are getting the better of me

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

    Latest Awards:

    Default

    Please note quite a number of browsers use the word Mozilla in there agent name. AOL, IE, Firefox, Googlebot - more and more. useragentstring.com

    Or are you trying to target Firefox?

    I have coded a function that works pretty well or you can use get_browser()


    PHP Code:
    <?php

    /* Id: browser.inc.php, Version: 004 */

    #########################################################################
    ##################### Uploadz Nyx - FIRST WRITE #########################
    ################ Coded by Danny Milner @  Uploadz.co.uk #################
    #########################################################################

    function agent_browser($agent){

        if(
    eregi("Opera/"$agent)){
        
    $browser "Opera";
        }

        elseif(
    eregi("msie"$agent)){
        
    $browser "Microsoft Internet Explorer";
        }

        elseif(
    eregi("firefox/"$agent)){
        
    $browser "Mozilla Firefox";
        }

        elseif(
    eregi("AppleWebKit/"$agent)){
        
    $browser "Safari";
        }

        elseif(
    eregi("Netscape/"$agent)){
        
    $browser "Netscape";
        }

        elseif(
    eregi("LibWWW"$agent)){
        
    $browser "LibWWW";
        }

        elseif(
    eregi("K-Meleon/"$agent)){
        
    $browser "K-Meleon";
        }

        elseif(
    eregi("Konqueror/"$agent)){
        
    $browser "Konqueror";
        }

        elseif(
    eregi("Camino"$agent)){
        
    $browser "Camino";
        }
        
        elseif(
    eregi("Flock"$agent)){
        
    $browser "Flock";
        }


        else{
        
    $browser "Unknown";
        }

    return(
    $browser);

    }

    ?>
    Last edited by Luckyrare; 25-07-2007 at 02:41 PM.

  7. #7
    Join Date
    May 2007
    Location
    Nebo, NC, USA
    Posts
    2,517
    Tokens
    0

    Latest Awards:

    Default

    hmm thats a nice function danny

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

    Latest Awards:

    Default

    Quote Originally Posted by Dentafrice, View Post
    hmm thats a nice function danny
    Thank you x]

  9. #9
    Join Date
    May 2007
    Location
    Nebo, NC, USA
    Posts
    2,517
    Tokens
    0

    Latest Awards:

    Default

    ok ontopic: why do you need this anyway?

    off: when will nyx be eready

  10. #10
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    Thanks Danny And ye, the message was still showing up for IE users..

    and im pretty sure i need to spread first to rep you.

    And i need it, because my site has basically no compatability for firefox, and danny, ive added the background colour to most of the pages, but all the orientations are different.
    Last edited by MrCraig; 25-07-2007 at 03:03 PM.
    Coming and going...
    Highers are getting the better of me

Page 1 of 2 12 LastLast

Posting Permissions

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