Jump to content

IE


Maurice79

Recommended Posts

I use basically only firefox for all my internet browsing and edited/created a few webpages. By accident i used IE to visit the pages and couldn't believe my eyes, it are totally different pages when viewing them with IE! Everything is messed up and borders are added i never added to the script or heights i never put that high. How is this possible? Is it possible to block the pages for IE users because i don't want people see the pages in IE view. To see what i mean click here.

Link to comment
Share on other sites

I can't, i rarely know what i did now to create it. How is this possible because other sites look the same in IE and FF, can't i just block IE users form the pages, sorry for IE users but if you don't use a proper browser you dont earn the pages. Ofcourse the last thing i said is a joke, im just pissed off IE fuck up the pages and it seems i did everything for nothing because IE and FF users should view both the pages.

Link to comment
Share on other sites

No...

 

1) You don't understand regular expressions properly. .+?MSIE.+? is the same as just MSIE.

2) Regex is overkill. Just use strpos.

However, 3) Browser detection cannot be relied on. See: http://webaim.org/blog/user-agent-string-history/

4) Blocking users like that is bad. The text can be read just fine even though some things may be mispositioned.

 

Just use IE conditional comments to display a message to the user telling them to upgrade to a newer version of IE or pick a better browser. In that way they can still read the content with a broken layout.

Link to comment
Share on other sites

Or you could do this:

 

echo (preg_match('#MSIE#',$_SERVER['HTTP_USER_AGENT']))? 'You are using IE. I\'m so sorry :*(' : 'Wlecome to the modern world, non IE user!';

 

Granted, not all IE versions are equal.. perhaps checking to see which version is in use if it is used?

 

if (preg_match('#MSIE (\d+)#', $_SERVER['HTTP_USER_AGENT'], $match)){
if ($match[1] < 7){
	// send the user to hell and make'em pay!!!
} else if($match[1] == 7){ // IE 7 detected..
	// Ok, version 7 is better than 6 or under, proceed...
}
}

 

or, if you are knowledgable enough with apache mod_rewrite, I think you can have built in redirects using an .htaccess file.

 

EDIT - Or strpos as Dan mentioned would work too.

Link to comment
Share on other sites

 

Interesting synopsis of the browser emulation evolution. Certainly (in the case of 'MSIE', older browsers (such as older Opera versions) did indeed have those letters in the value of $_SERVER['HTTP_USER_AGENT'] (but not so much anymore). Searching for 'Mozilla' will still definitely cause some issues I would think. From what I read once, it is ultimately better to test for browser features instead of browser agent info and make decisions based on that.

 

If one does check through agent info, I suppose it's best to really make some additional checks to ensure they have the correct agent to begin with. I'm not so terribly concerned with "MSIE" to be perfectly honest. I would be with "Mozilla" though.

Link to comment
Share on other sites

Code on XHTML strict. When I was working on my second website, I was able to code properly for IE, Firefox and other Mozilla based web browsers. I did that by coding on XHTML Transitional.

 

... But later I considered the fact that a lot of people use Safari as their browsers. Google Chrome is widely used now as well, and both have the same rendering engine. They I tried my XHTML Transitional website on those browsers. And lord should you have seen the mess I created. Later I found out that coding on XHTML Strict increases your chances of making a website that looks fine on almost every browser.

 

Checking the user client with PHP is not always a reliable method. I heard that people can choose whether they can send the client information to the server or not.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.