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
    Feb 2008
    Location
    Scotland
    Posts
    151
    Tokens
    500

    Latest Awards:

    Default How to show something diffrent for IE user?

    Is there a way if a IE user comes on my website...I can make it display a completely diffrent page..from the users who use FireFox etc?

  2. #2
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    Well i think an effective way to do it would be to use php.

    Using conditional if statements you can create something along the lines of

    PHP Code:
    <?
    echo "
    <!--[if IE]>"
    ;
    include 
    "internetexplorerfile.php";
    die();
    echo 
    "
    <![endif]-->

    PAGE FOR OTHER BROWSERS SUCH AS FIREFOX HERE.
    "
    ;
    That would include that file then it would die so that the rest of the page isn't displayed.

    If not then you could just use

    HTML Code:
    <!--[if IE]>
    <meta http-equiv="refresh" content="0.1; url=http://INTERNETEXPLORERLINK.com">
    <![endif]-->
    Both of them should work..

  3. #3

    Default

    Erm, Jack your first example won't work because you're mixing HTML and PHP, PHP doesn't take into account the conditional comments, you'll have to make an if statement in PHP for it to work. E.g.

    PHP Code:
    <?php
    if (strpos($_SERVER['HTTP_USER_AGENT'], "MSIE") !== false)
    {
      
    header("Location: http://www.domain.com");
    }
    ?>
    also you can use javascript
    Code:
    <script type="text/javascript">
    if (navigator.appName === "Microsoft Internet Explorer")
    {
      window.location = "http://www.domain.com";
    }
    </script>
    furthermore you can use the user agent.
    Code:
    <script type="text/javascript">
    if (navigator.userAgent.search(/MSIE/) !== -1)
    {
      window.location = "http://www.domain.com";
    }
    </script>
    As for the conditional comment as Jack posted
    Code:
    <!--[if IE]>
    <meta http-equiv="refresh" content="1;url=http://www.domain.com">
    <![endif]-->
    This should do it if the browser supports the refresh like Jack posted, not sure if it has any drawbacks though. The other two you can have the browser user agent spoofed and people can simple disabled javascript so no solid way unless the conditional comment meta refresh works.

  4. #4
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Iszak View Post
    Erm, Jack your first example won't work because you're mixing HTML and PHP, PHP doesn't take into account the conditional comments, you'll have to make an if statement in PHP for it to work. E.g.

    PHP Code:
    <?php
    if (strpos($_SERVER['HTTP_USER_AGENT'], "MSIE") !== false)
    {
      
    header("Location: http://www.domain.com");
    }
    ?>
    also you can use javascript
    Code:
    <script type="text/javascript">
    if (navigator.appName === "Microsoft Internet Explorer")
    {
      window.location = "http://www.domain.com";
    }
    </script>
    furthermore you can use the user agent.
    Code:
    <script type="text/javascript">
    if (navigator.userAgent.search(/MSIE/) !== -1)
    {
      window.location = "http://www.domain.com";
    }
    </script>
    As for the conditional comment as Jack posted
    Code:
    <!--[if IE]>
    <meta http-equiv="refresh" content="1;url=http://www.domain.com">
    <![endif]-->
    This should do it if the browser supports the refresh like Jack posted, not sure if it has any drawbacks though. The other two you can have the browser user agent spoofed and people can simple disabled javascript so no solid way unless the conditional comment meta refresh works.
    You're right, i made a well nooby mistake

  5. #5
    Join Date
    Aug 2008
    Posts
    206
    Tokens
    0

    Default

    Iszak saves the day, once again.

Posting Permissions

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