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
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
}

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.