Jump to content
xisto Community
KansukeKojima

Internet Explorer Sucks Yeah, I said it.

Recommended Posts

I'll give you guys a special sneak preview of this tutorial... a good ten minutes before it comes out on my website... enjoy.

 

Internet Explorer Sucks

 

 

Description

Its time to send those pesky Internet Explorer users a message. Learn how with my brand new "IE Sucks" PHP Code. (Only $29.99, but wait there's more!)

 

Try It Out

Alright, in order to give those IE users what they deserve we will be using the good ol' HTTP_USER_AGENT command. This command grabs the users browser name, etc. Its also useful for all kinds of other things such as stalking somebody.... *cough*

 

 

<?php$browser = $_SERVER['HTTP_USER_AGENT'];?>

Alright, good job, young php-learner. As you can probably guess, this does pretty much nothing.

 

So far all we have done is create the $browser variable and given it a value. Next we'll create the message for those IE users.

 

<?php$browser = $_SERVER['HTTP_USER_AGENT'];if(strstr($browser, "MSIE")) {$message = "You *_edit_*, you're using Internet Explorer. Get something else now!";} else {$message = "You are not using Internet Explorer. Good.";}echo $message;?>
Ok, so basically, if the value of the $browser variable (which contains the HTTP_USER_AGENT command) has the phrase MSIE (Microsoft Internet Explorer) somewhere in it, the page calls the viewer a douchebag... And if they are not using MSIE, then it pats them on the back.

 

Of course you can always modify this code to say "Good job" to MSIE users, etc. Or insult users of different browsers... in general, this is a very fun code to play around with and I hope you enjoy it.

Notice from jlhaslip:
Edit word as per above.

Share this post


Link to post
Share on other sites

i dont know the code but i know that IE drags to himself all kinds of toolbars i had once 4 or 5 at once . i switched to firefox witch just god popular (right before windows vista and new *IE) i liked it becouse of tabs .but i cant get used to IE again -> wheneever i reinstall widows the first thing i download is Firefox

Share this post


Link to post
Share on other sites

First of all that code is not intended in such way that is I think that you are misusing the code provided :) why? because this code is in face intended to help developers because different browsers have different ways of showing very different things and if you are clever enough to use some programs like dreamwaver then you may find that it has compatibility check this is one of its integrated options and this will help you because then you can adjust your code to return correct encoding for the computer that is using your site.Also remember that the thing that is very important is that internet explorer is still the most used browser today and something else internet explorers things that infacted me and most of the users the most are in fact its integration with the micrsoft operating system windows and as internet explorer was integrated into the kernel in windows xp this produced many problem and security issues however now things should have changed since it is no longer integrated in the kernel of operating system making it more reliable and a lot more secure.And one more final thing I use mozilla firefox because it is a lot betteer and more usuful then internet explorer or any other browser nto because other browsers "suck".Regards

Share this post


Link to post
Share on other sites

Although I agree IE is not good, and that the tutorial title is misleading... please try to keep comments relative to the tutorial... not your comments on IE... please.

Share this post


Link to post
Share on other sites

Well I suppose that instead of hate-messages, have different layout codes etc. to suit different browsers.... I'll write that up later... unless someone else does.

Share this post


Link to post
Share on other sites

You can even use Javascript just like this one:

<script type="text/javascript">var browser = navigator.appNamevar type = "Microsoft Internet Explorer"if ( browser == type) {   alert('You are using Internet Explorer!!');   alert('Just click OK to download Firefox LOL!!');   document.location = "https://www.mozilla.org/en-US/firefox/new/;; }</script>

Hehe.. Just sharing.. :)

Share this post


Link to post
Share on other sites

I find firefox and Internet explorer equal. I happen to use both of them for certain things. Firefox is better than internet explorer on most cases, but internet explorer has better tabbing (My Opinion!) :)

Share this post


Link to post
Share on other sites

Ok, I have replaced the old tutorial on my website with this one... bassically the same... except its about increasing browser compatibility, instead of telling people internet explorer sucks... I think that its a better idea, as its less offensive ( I honestly don't know who would take offense), and has more of a point.

Description

With so many different browsers, people have a long list to choose from. Unfortunately, that is when we run into problems with a website's performance. Since most browsers read HTML, CSS etc. slightly different than the next browser, your website may not look how you wanted. Let's learn to fix this problem.

 

Try It Out

If we want to make our website compatible with different browsers, we'll have to know which browsers the viewers will be using. We can grab this with the good ol' HTTP_USER_AGENT command.

 

 

Code

<?php

$browser = $_SERVER['HTTP_USER_AGENT'];

?>

 

Alright, good job, young php-learner. As you can probably guess, this does pretty much nothing. So far all we have done is create the $browser variable and given it a value. Now we are ready to make our website more compatible.

 

 

Code

<?php

//--------------

//grab user info

//--------------

$browser = $_SERVER['HTTP_USER_AGENT'];

 

//--------------

//compatible content

//--------------

if(strstr($browser, "MSIE")) {

$compatible = <<<html

Code Compatible for Internet Explorer

html;

} else {

$compatible = <<<html

Code Compatible for Other Browser(s)

html;

}

echo $compatible;

?>

 

Ok, so bassically, if the value of the $browser variable (which contains the HTTP_USER_AGENT command) has the phrase MSIE (Microsoft Internet Explorer), it shows you whatever you replace "Code Compatible for Internet Explorer" with. If it doesn't contain MSIE then it echoes what ever you replace "Code Compatible for Other Browser(s)" with. Also, you can use this to add special features to your website depending on what browser they are using. Play around with the code, and add your own flavours and ideas to it.


Notice from rvalkass:

Even if you copy from your own website, it should really be quoted.


Share this post


Link to post
Share on other sites

When i changed to FireFox, my internet was wayy faster (my bandwith runs out frequently)According to my friend, IE takes longer to load up the page (not downloading)

Share this post


Link to post
Share on other sites

Had it not occured to you, that you could use javascript for that?just create a variable for weather or not it is IE, then a statement for when it is, and an ELSE for if it isnt. Thus, relieveing some strain from your web host, as the server does not have to process it, the clients computer does it itself.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.