CodeIgniter Forums
Disallow access from Internet Explore 6 and 7 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Disallow access from Internet Explore 6 and 7 (/showthread.php?tid=21620)

Pages: 1 2 3


Disallow access from Internet Explore 6 and 7 - El Forum - 08-16-2009

[eluser]wiredesignz[/eluser]
[quote author="jayrulez" date="1250451522"]
Where do you get off referring to me as a spammer? Show me how i was spamming by trying to help the topic author?
[/quote]

If I were seeking help about this framework I would be pretty annoyed getting a pure PHP solution when CodeIgniter actually provides the tools I needed.

And you do seem to enjoy telling us about other frameworks as often as possible. (Your signature for example)

EDIT:
Apologies to the OP and the community for taking this off topic.


Disallow access from Internet Explore 6 and 7 - El Forum - 08-16-2009

[eluser]jayrulez[/eluser]
[quote author="wiredesignz" date="1250475818"][quote author="jayrulez" date="1250451522"]
Where do you get off referring to me as a spammer? Show me how i was spamming by trying to help the topic author?
[/quote]

If I were seeking help about this framework I would be pretty annoyed getting a pure PHP solution when CodeIgniter actually provides the tools I needed.

And you do seem to enjoy telling us about other frameworks as often as possible. (Your signature for example)[/quote]

If I were seeking help about this framework I would rather seeing a helpful answer rather than an arguement about something totally unrelated to my query like what you have started, and until an admin outlaws it, i don't see any reason why i should change or remove the link in my signature. You do what you want to and I'll do what i want to, but regardless, i suggest you help the poster or stop wasting the time of readers with the pointless blabber.

I have seen so many "real" spammers here and you have yet to start bashing them but as soon as i posted you had to dig deep and find a problem with it. Based on that, i think it's safe to assume spamming is not your problem but I am. However, this is the internet and there is nothing you can do about me... So let us just move on... mariposo


Disallow access from Internet Explore 6 and 7 - El Forum - 08-16-2009

[eluser]darkhouse[/eluser]
Since we still don't know the real reason why the OP wants to block IE 6 and 7, I figured I'd just chime in real quick.

Since he's not blocking IE 8, I wonder if he's promoting IE 8 and forcing users to upgrade before they can see his site. If that's the case, I want to point out that I think IE 8 has more problems than IE 7 had, even though it's more standards compliant. I hoped IE 8 was going to solve a lot of problems, but it ended up creating new ones, so I don't believe in forcing users to upgrade.

Or, if it's just so that you don't have to worry about developing for IE's silliness, then brianw1975 is right, you're blocking the majority of internet users, and while it's a shame that it's like that... it's like that. The good thing is, if you stick to the standards, you'll eventually develop a system that works for you that requires very little modding to make IE play nice. One thing I like to do is put in some conditional divs, like this:

Code:
<body>
&lt;!--[if IE]><div id="ie"><![endif]--&gt;
&lt;!--[if lte IE 7]><div id="ie7"><![endif]--&gt;
&lt;!--[if lte IE 6]><div id="ie6"><![endif]--&gt;

<div id="container">
Your real HTML here...
</div>

&lt;!--[if lte IE 6]></div><![endif]--&gt;
&lt;!--[if lte IE 7]></div><![endif]--&gt;
&lt;!--[if IE]></div><![endif]--&gt;
&lt;/body&gt;

That way you can develop things how you want and then if there are IE specific css issues you can just add new styles in your css file with the appropriate IE id. Something like this is common:

Code:
#container { background-color: #f00; min-height: 500px; }
#ie6 #container { height: 500px; }

It also keeps all of your code w3c compliant, instead of using tricks/hacks like _height and whatnot.

Anyways, just my two cents.


Disallow access from Internet Explore 6 and 7 - El Forum - 08-16-2009

[eluser]wiredesignz[/eluser]
@darkhorse, The OP wrote that he wishes to detect the browser and redirect if IE6 or IE7 is detected.

He never mentions blocking.


Disallow access from Internet Explore 6 and 7 - El Forum - 08-16-2009

[eluser]darkhouse[/eluser]
@wiredesignz: The subject says "Disallow access from Internet Explorer", and it's DarkHouse, btw


Disallow access from Internet Explore 6 and 7 - El Forum - 08-16-2009

[eluser]wiredesignz[/eluser]
Well let me quote the OP again for everyone just to prevent further obvious confusion.

[quote author="pianoman993" date="1250406240"]... Is there a feature already or how could I implement a way for the system to check if the browser is internet explorer 6/7 and redirect the user to a new page? ...[/quote]


Disallow access from Internet Explore 6 and 7 - El Forum - 08-16-2009

[eluser]darkhouse[/eluser]
Lol, I don't think there's any confusion, I think we're on the same page. The subject is "disallow access from Internet Explorer 6 and 7" and then he wants to redirect those users to a new page... It seems to me that he just doesn't want older versions of IE to be able to access the site. However, he never stated what his real reason for that was, I was simply providing a little insight into why that's not necessarily the way to go.


Disallow access from Internet Explore 6 and 7 - El Forum - 08-16-2009

[eluser]skunkbad[/eluser]
The OP's answer:

Code:
if($this->agent->browser() == 'Internet Explorer' && ($this->agent->version() == '6.0' OR $this->agent->version() == '7.0'))
{
     redirect('some_page');
}



Disallow access from Internet Explore 6 and 7 - El Forum - 08-16-2009

[eluser]wiredesignz[/eluser]
That's awesome skunkbad, Thanks, this offers me some new ideas also.

Code:
$this->load->library('user_agent');
if($this->agent->browser() == 'Internet Explorer' AND in_array($this->agent->version(), array('6.0','7.0')))
{
     redirect('some_page');
}



Disallow access from Internet Explore 6 and 7 - El Forum - 08-16-2009

[eluser]skunkbad[/eluser]
You know, I forgot to load the library, which is important!

As for the "correct" way to do things, I think if the OP wants to show one view to IE6 and IE7 users, and one to everyone else, or if the OP wants to serve one stylesheet to IE6 and IE7 users, and one stylesheet to everyone else, it would be better not to redirect the user to a different controller. The true reason to use MVC is such that the view can be changed, or variables passed to the view can be changed. It's kind of hard to tell exactly why the OP wants the redirect, because that information hasn't been given to us.

So OP, what are you doing?

On my site, I use a main template view, and insert other views into it inside the controller. This main template view has code that outputs stylesheets as needed:

Code:
for($x=0;$x<=count($style_sheet_names)-1;$x++)
{
     echo link_tag($style_sheet_names["$x"],'stylesheet','text/css','',$media_targets["$x"])."\n";
}

Inside the controller, if I want to insert stylesheets, I would do something like this:

Code:
$data = array(
    'style_sheet_names' => array(
        'css/reset.css',
        "css/$page_style.css",
        'css/page_specific/contact/screen.css'
    ),
    'media_targets' => array(
        'screen',
        'screen',
        'screen'
    )
);
$this->load->view('template_content', $data );

But this could be changed easily for IE6 and IE7, using an if statement such as mentioned in the previous two posts. Of course my example here only applies to stylesheets, but the same can be done with views, javascripts, or anything really. The beauty of CI and MVC is that you can do anything!