Jump to content

If/Then Browser Detection


Applellial

Recommended Posts

I have done some searching and digging, but it seems everyone has their own ways of doing things, some more effective than others.

 

I have a web design portfolio website, which uses a "coinslider" flash slideshow. It looks awesome in FF, but IE6/etc users cant view it properly.

 

How can I create a PHP if/then to detect if they are using a sub-par browser, and display a more simple slideshow?

 

That way it will work for all users, and those with Firefox and similar browsers can view the more interesting slideshow.

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/229632-ifthen-browser-detection/
Share on other sites

Use the get_browser() function. There is a nice user contributed function in the notes (2nd one, by 'ruudrp at live dot nl')

To ensure it worked, I would set the IF to show the flash slideshow only in tested browsers which work.

i.e.

$browser = get_browser(null, true);
if ($browser['browser']=='Firefox' || $browser['browser']=='Other working browser') {
//echo the flash
} else {
//echo the simple slideshow
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.