Jump to:

22977 Posts in 11758 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » detect IE6 ?

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 966 Views
  • snaip
    Avatar
    Community Member
    180 Posts

    detect IE6 ? Link to this post

    hi

    i have function which determine the type of IE version

    function ie6() {
       $przegladarka=$_SERVER['HTTP_USER_AGENT'];
       if(strpos($przegladarka, 'MSIE 6') == true) {
    echo "you are using IE6";
       }
       else {
        echo "you dont have IE6";
       }
    }

    and works good

    but now i need to include one .ss file when user have IE6 and second .ss file when he have other
    how to do it in template ?

    i tryed this:

    function ie6() {
       $przegladarka=$_SERVER['HTTP_USER_AGENT'];
       if(strpos($przegladarka, 'MSIE 6') == true) {
    $ie = 1;
       }
       else {
        $ie = 0;
       }
    }

    <% control ie6 %>
       <% if ie == 0 %>
    <% include non_ie_file.ss %>
       <% else %>
        <% include ie_file.ss %>
       <% end_if %>
    <% end_control %>

    but it doesnt work

  • snaip
    Avatar
    Community Member
    180 Posts

    Re: detect IE6 ? Link to this post

    ok i solved this problem

    function ie6() {
       $przegladarka=$_SERVER['HTTP_USER_AGENT'];
       if(strpos($przegladarka, 'MSIE 6') == true) {
          return true;
       }
       else {
          return false;
       }
    }

    <% if ie6 %>
    you have IE6
    <% else %>
    you dont have IE6
    <% end_if %>

  • Taffy
    Avatar
    Community Member
    119 Posts

    Re: detect IE6 ? Link to this post

    There is also a widget @ http://silverstripe.org/ie-6-detection/

    966 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.