Welcome Guest, Not a member yet? Register   Sign In
Disallow access from Internet Explore 6 and 7
#1

[eluser]markanderson993[/eluser]
Hello there Codeigniter gods, I have a small question for you.

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?

Any help would be greatly appreciated,
Thanks!!
#2

[eluser]brianw1975[/eluser]
I have to ask, why would you intentionally block ~66% of the browser market?
#3

[eluser]jayrulez[/eluser]
Code:
$browser = isset($_SERVER) ? $_SERVER['HTTP_USER_AGENT'] : getenv('HTTP_USER_AGENT');
if(stristr($browser,"msie 6" !== false || stristr($browser,"msie 7" !== false)
{
     header("Location:IEPage.html");
     //exit("IE 6 and 7 are blocked from viewing this page.");
}

you can add this to your entry point ie your index.php if you want to block ie6&7 from the site or add it to the controllers to which you want to restrict access from IE6&7
#4

[eluser]wiredesignz[/eluser]
@jayrulez, Why do you bother hanging around the forums when you have no clue of CodeIgniter based solutions? (Other than spamming with your signature.)

@pianoman, The input library allows you to work with the user agent.
Code:
$browser = $this->input->user_agent();
http:///user_guide/libraries/input.html
#5

[eluser]brianw1975[/eluser]
@pianoman993: You can't rely on the browser reporting the user_agent. Some firewalls strip it out, some browsers let you alter which one you have (Opera I think is the one that lets you set this), and some browsers don't provide one at all, but those are in the minority.

@jayrulez: not bad, but again, assumes that the user agent is provided by the browser.

@Wiredesignz: Seriously? You post to bash Jayrulez and don't bother to point out the flaws of trying to block based on user agent.
Quote:Returns FALSE if it's not available.
plus you don't even really take into consideration that using the CI function actually let's the request into the CI code at all -- why waste processing time on it if you aren't going to serve it anything worth the processing time.

@all: Finally, since we are assuming that the browser does provide a user agent, and assuming that pianoman993 is using Apache why not do this in the .htaccess file if we can?

Code:
#taken & modified from http://camendesign.com/code/mod_rewrite-css-targeting
RewriteCond %{HTTP_USER_AGENT} MSIE\s7\.
RewriteRule ^index\.html$ /index.IE.html [L]
#6

[eluser]wiredesignz[/eluser]
@Brian, The OP never mentions anything about blocking browsers, his reasons for wanting this information are obviously far different from what you have assumed.

However I am concerned about people providing answers here when they clearly have no knowledge developing with CodeIgniter.
#7

[eluser]jayrulez[/eluser]
[quote author="wiredesignz" date="1250417764"]@jayrulez, Why do you bother hanging around the forums when you have no clue of CodeIgniter based solutions?
(Other than spamming with your signature.)
Code:
$browser = $this->input->user_agent();
The input library allows you to work with the user agent.
http:///user_guide/libraries/input.html[/quote]

1. Are you always this friendly?
2. Was my solution wrong?
3. Why did you not address the problem instead of commenting on whether or not I have codeignitor savvy and my signature (I would venture to say that most of us have links in our signatures, why not take a jab at other members as well?).
4. sigh!
#8

[eluser]wiredesignz[/eluser]
Friendly? Yes to genuine contributors. But I'm not very tolerant of spammers or people who provide erroneous information.

Your solution was not based on using the tools provided by the framework, these are CodeIgniter forums after all.

@pianoman, a complete list of browsers detected by CI is located in the config/user_agents.php configuration file.
#9

[eluser]jayrulez[/eluser]
[quote author="wiredesignz" date="1250428186"]Friendly? Yes to genuine contributors. But I'm not very tolerant of spammers or people who provide erroneous information.

Your solution was not based on using the tools provided by the framework, these are CodeIgniter forums after all.

@pianoman, a complete list of browsers detected by CI is located in the config/user_agents.php configuration file.[/quote]

Where do you get off referring to me as a spammer? Show me how i was spamming by trying to help the topic author?

[removed by mod]
#10

[eluser]Johan André[/eluser]
So, what is the correct way to do it? Javascript + serverside?

I wanna block all fucked-up browsers (Internet Explorer mostly) from my backend.
Actually I want to block IE from the frontend too, but that might be going too far. Smile

I probably add some nagging message about upgrading when people are using outdated browsers in the frontend.

EDIT: Haha! the forum blocks the f-word! Smile




Theme © iAndrew 2016 - Forum software by © MyBB