Jump to content

Detecting flash IE8


damiantaylor

Recommended Posts

Hi,

I have some php code to detect if a browser has the flash plugin.

It works great in Fire Fox but in Internet Explorer 8(I haven't been able to test in other versions yet) it doesn't work on entry to my site, but if you hit refresh it suddenly works  :shrug:

 

Here's a link to my test site so you can see what I mean:

 

http://snow.byethost8.com/shop/

 

When you first go in, right click the main image and you'll see it's an image because you get the 'Save picture as' option.

Now hit refresh and do the same thing.....it's now flash!

 

Is there a better way to detect flash using php?

 

Here's the code I'm using:

<?php
// Search through the HTTP_ACCEPT header for the Flash Player mime-type.
$swfheader = strpos($_SERVER['HTTP_ACCEPT'],'application/x-shockwave-flash');
if($swfheader === false)
{
$hasFlash=true;
}
else
{
$hasFlash=false;
}
?>

Link to comment
https://forums.phpfreaks.com/topic/192858-detecting-flash-ie8/
Share on other sites

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.