<?
// Search through the HTTP_ACCEPT header for the Flash Player MIME type.
if (strstr($_SERVER['HTTP_ACCEPT'], 'application/x-shockwave-flash'))
{
$hasFlash = true;
}

if ($hasFlash)
{
require('flash.html');
} else {
require('noflash/index.html');
};

?>

But it does not work for Safari Mac

Adobe's Flash detection kit pdf has to say something about this:-

"The following issues with server side detection should be closely noted. Internet Explorer on Mac OS is hard-coded to accept '/' and cannot be modified dynamically. Secondly, users can manually uninstall Flash Player by deleting the executable itself. This casuses the custom accept header to be “orphaned” such that server detection logic thinks Flash has been installed, when in fact it is no longer available. It is also possible to disable ActiveX controls through the Windows XP Service Pack 2 security settings, which will similarly cause the custom accept header to be orphaned."

So is there any foolproof way to detect flash with PHP (for users who have javascript disabled) ?

    Write a Reply...