Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> A Message To Visitors Who Use Ie, PHP script to use on your site
abhiram
post Feb 17 2006, 02:20 AM
Post #1


Hedonist at large
Group Icon

Group: Members
Posts: 610
Joined: 30-July 05
From: another realm
Member No.: 7,524



I found a very neat PHP script which will show a message to people who use IE only. It doesn't show anything if you use any other browser biggrin.gif.

Here's the source.

I've used it on my site already. If anyone is interested to see it in action, just click on my sig and check it out in IE smile.gif.
Go to the top of the page
 
+Quote Post
mastercomputers
post Feb 17 2006, 03:20 AM
Post #2


PESTICIDAL MANIAC
Group Icon

Group: Members
Posts: 626
Joined: 1-September 04
From: Auckland, New Zealand
Member No.: 27



This was the code taken from that link:

CODE

if(eregi('MSIE', $_SERVER['HTTP_USER_AGENT'])){
    echo '<div>
                      Bla Bla Bla your text explaining why people should switch to Firefox.
              </div>';
}


This is how I would write it:

CODE

if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'msie')){
  echo '<p>Blah blah blah your text...</p>';
}


There's other ways to do it, but I think it's overkill using eregi, which is the case insensitive regular expression function, preg_match is quicker than ereg. However I find strpos to be faster than both these, and all it returns is the position it found the string you were looking for, if the string however is the first element, it will not work, because position will be 0 and considered false.

Cheers,

MC
Go to the top of the page
 
+Quote Post
abhiram
post Feb 17 2006, 04:15 AM
Post #3


Hedonist at large
Group Icon

Group: Members
Posts: 610
Joined: 30-July 05
From: another realm
Member No.: 7,524



Hehe ... well that's sprucing it up a bit smile.gif. Thanks, this works just fine as well.
Go to the top of the page
 
+Quote Post
Biffaboy
post Feb 17 2006, 03:05 PM
Post #4


Newbie [ Level 2 ]
Group Icon

Group: Banned
Posts: 15
Joined: 16-February 06
Member No.: 11,334



Nice, im putting this on my site smile.gif
Go to the top of the page
 
+Quote Post
Hraefn
post Feb 18 2006, 02:20 PM
Post #5


Member [ Level 2 ]
Group Icon

Group: Members
Posts: 65
Joined: 28-July 05
Member No.: 7,488



Putting something like that on a website is a double-edged sword. On one hand, you're spreading the word on Firefox and why it's a better alternative browser to IE. On the other hand, your basically telling any IE users who visit your site that they'll just be annoyed with that message every time they visit your site. It runs the potential risk of getting people to not switch to Firefox but rather to avoid your site like the plague. =^^=

On the plus side, I like how this message is a lot more subtle than the pop-ups that used to be so frequent in the past. =^^=
Go to the top of the page
 
+Quote Post
szupie
post Feb 18 2006, 03:39 PM
Post #6


S.P.A.M.S.W.A.T.
Group Icon

Group: Members
Posts: 814
Joined: 22-January 05
From: San Antonio, Texas (No, I'm not dumb. I just moved here...)
Member No.: 2,284



You could also do this with css:

First, the html code:
CODE
<p id="firefox">This site will self destruct in 10 seconds if you don't get Firefox</p>


Now, the css code (could be embedded or included in an external file):
CODE

#firefox {
  display: none;
}
* html #firefox {
  display: inline;
}


Every css-capable browser would pick up the first style, which would hide the paragraph with the "firefox" id. Then, in the next style, since the extra asterisk makes the css invalid to Firefox (and possibly many other browsers), Firefox will ignore it and keep the paragraph invisible. But since IE is so weird and still accepts the second style, it'll change the paragraph back to visible.
Go to the top of the page
 
+Quote Post
abhiram
post Feb 18 2006, 07:23 PM
Post #7


Hedonist at large
Group Icon

Group: Members
Posts: 610
Joined: 30-July 05
From: another realm
Member No.: 7,524



laugh.gif

QUOTE
IE is so weird


You're so right about that. That's a pretty neat idea as well smile.gif.
Go to the top of the page
 
+Quote Post
jake658879
post Mar 7 2006, 03:08 AM
Post #8


Member [ Level 1 ]
Group Icon

Group: Members
Posts: 30
Joined: 20-February 06
Member No.: 11,416



lol make the message on your website display "Internet Explorer is a horrible, peice of crap web browser. If you do not switch to firefox you are an idiot. here is the download link. http://www.mozilla.com/firefox/ Firefox does things 100x better than crappy Internet Explorer. Try it and find out for yourself what youve been missing out." I know thts long but thts wut i'm going to use because people need to know tht they have to get rid of IE. And when they get firefox, they will "Rediscover the web". That is the truth.
Go to the top of the page
 
+Quote Post
Hercco
post Mar 7 2006, 05:45 AM
Post #9


Super Member
Group Icon

Group: Members
Posts: 595
Joined: 4-September 04
Member No.: 228



You got to remember that not all people can change their borwser. They might not have the skills to install software, they are scared of downloading new software or simple they are not allowed to: you usually cannot install new software on that office PC.

I don't like IE, and I'd like to educate people to change their browser. I used to have that kind of warning for IE but I decided later that it's not that cool. I bet it annoyed more people than it converted. Instead now I have Firefox and Opera download logos on the bottom of my site. They don't get on people's face but some people will notice them and undestand that I recommend these browsers and that my site functions well with these browsers.

Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. 10 Gb Data Storage For Free!(54)
  2. Know Of Any Good Free Ftp Host Site?(8)
  3. Need Help To Install Live Web Cam On My Site(3)
  4. Visit My Site, Internet Stops For A While(8)
  5. Gamespot.com: Gaming Site With Cool Features(6)
  6. Facebook: School Connection Site(8)
  7. Site Namer(7)
  8. Get Your Site Listed In A Top Ranking Directory(4)
  9. FPS Banana : The Site For Counterstrike Skins Etc.(2)
  10. Hosting Your Site From Home(5)
  11. How To Promote My Site?(10)
  12. Yourspins(0)
  13. Statscounter New(6)
  14. Php Script/tutorial Test Site Another Xisto Service Possibility(10)
  15. Mofunzone.com(2)
  1. Lissaexplains.com(htmlhelper Site For Newbies)(2)
  2. Finding Where A Site Is Hosted ?(11)
  3. Asp Script(0)
  4. How To Get Viewers To My Site ?(11)
  5. On Site Forum(6)
  6. How To Install Invisionfree Forums To My Site?(15)
  7. A Site To Be Proud Of(0)
  8. My Site Just Got Rooted.........(5)
  9. Another Website Experiencing Problems(4)
  10. The Best Free File Hosting Site !(6)
  11. Does Anyone Knows How Does This Site Work(6)
  12. How To Enable My Site For Credit Card Payments.(4)
  13. Does This Site Mean Anything To Us…i Don’t Know U Tell Me?(4)


 



- Lo-Fi Version Time is now: 5th December 2008 - 12:55 AM