#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Posts
    39
    Rep Power
    0

    IE browser Check


    I am using this code, to check if the browser is IE and has Compatibility turned on... if so the page will not display right, so I want to show the user how to easily turn it off, if they do not know how, but the code is not working. Can you tell me how to make it work?

    PHP Code:
    if(isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) && (strpos($_SERVER['HTTP_USER_AGENT'], 'compatible') !== false)) {
    echo <<<EOS
    <div style="color: #FF0000; font-size: 20px;">Warning. You have Compatibility Mode TURNED ON in this browser, which will make everything below here not look right... to view this page right, turn it OFF, just click this in your window, above:<br /><img src="/images/turnOffCompatibility.png" title="Turn Off Compatibility" border="0"></div>
    EOS;
    } else {
    echo <<<EOS
    Your Browswer is ok...
    EOS;

    Neither thing shows up, not the first message or the else message... so something is wrong.

    Can you help me, please?

    Thank you in advance.
    Richard
  2. #2
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,180
    Rep Power
    9398
    If you write your pages correctly then IE will switch to the right mode automatically. If the user decides to override that with their own choice then it's their fault if something doesn't work.

    Assuming your pages already validate, X-UA-Compatible.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Posts
    39
    Rep Power
    0
    Originally Posted by requinix
    If you write your pages correctly then IE will switch to the right mode automatically. If the user decides to override that with their own choice then it's their fault if something doesn't work.

    Assuming your pages already validate, X-UA-Compatible.

    This page is on a wordpress site, the problem is that I am using a plugin that builds a table and a plugin that builds videos, there are like 17 videos so I show 3 per row...
    wordpress aligns them 3 per row, automatically, which works fine, but for every 3, I check if opera browser and add two lines, which wordpress changes into paragraphs, which does drop the next 3 videos down below the previous 3, if I don't do that then Opera puts them all on one line, and creates a huge scroll bar.

    But if I add that, it fixes it in opera.

    But the problem in IE is that it only puts 1 row, and drops each video under the next, all the way down the page, but if the compatibility is turned OFF, it displays fine.

    So I just want to have the compatibility turned off.
    Is there a way to have IE automatically turn compatibility off?

    Let me know.
    Thank you.
    Richard
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Posts
    39
    Rep Power
    0

    fixed


    PHP Code:
     Adding this seemed to fix the way it displayednow it all lines up right if compatibility view is on or not: <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" /> 

    thank you.
    Richard

IMN logo majestic logo threadwatch logo seochat tools logo