Re: RE: [PHP] Flash detection

From: Date: Mon, 28 Aug 2000 01:33:19 +0000
Subject: Re: RE: [PHP] Flash detection
Groups: php.general 
Request: Send a blank email to php-general+get-13875@lists.php.net to get a copy of this message
Actually I find that solution to be interesting. Another idea to expand upon that is to do as your doing but have a page that when loaded runs a phpfunction that stores an item in the session. Then you will have in essense tagged that session as flash enabled and you can then know in advance whether or not to generate of snd more flash to the user. I know I'm butting in but the idea hit me as I was reading the thread. Eric Naujock. >>> Jason Murray <Jason.Murray@melbourneit.com.au> - 8/27/00 10:25 PM >>> Bill wrote: > There is a very easy and (I think) fool proof way to detect Flash. > (I am not a Flash or Php expert, but I use this on both of my sites). > > Create a Flash movie that has only 2 frames. > The 2nd frame should have the action to Get URL(http://yourflashpage.html). > Generate the Html file, and add a meta tag which redirects the browser > to the non-flash page after (say) 10s. I think that'll work, but it's still reliant on Flash being present. Since PHP cannot check the incoming browser for Flash abilities, this needs to be done in JavaScript. I pulled the following code together for Flash detection on a site earlier this year, it seems to work reasonably well: <SCRIPT LANGUAGE="JavaScript"> <!-- //Look for a version of Internet Explorer that supports ActiveX (i.e., one that's //running on a platform other than Mac or Windows 3.1) or a browser that supports //the plugin property of the navigator object and that has Flash Player 2.0 //installed. if ((navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.indexOf("Mac") == -1 && navigator.appVersion.indexOf("3.1") == -1) || (navigator.plugins && navigator.plugins["Shockwave Flash"]) || navigator.plugins["Shockwave Flash 2.0"]) { // Go ahead and play the Flash. document.write('<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD>\n'); document.write('<OBJECT --blah-->\n'); document.write(' <PARAM --blah-->\n'); document.write(' <EMBED --blah--></EMBED>\n'); document.write('</OBJECT></TD></TR>\n'); document.write('</TABLE><BR>\n'); document.write('<A HREF="mainpage.php3"><B>Main Menu</B></A>\n'); } else { //Load a pre-defined HTML page without Flash Player into the browser window. window.location='mainpage.php3'; } // --> </SCRIPT> Of course, you'll need to add a <NOSCRIPT> tag to do the <META> redirection... client didn't want it, so it's not here sorry :) Jason -- Jason Murray jasonm@melbourneit.com.au Web Design Team, Melbourne IT Don't believe everything you're foretold. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#13875) next »