Reply
using results ffrom javascript/vbscript in php
Old 07-30-2006, 02:31 PM using results ffrom javascript/vbscript in php
numbenator's Avatar
Ultra Talker

Posts: 411
Location: London
HI there,

I've picked up a couple of vbscript/javascript functions that enable me to check across all browsers ther flash player version. Including IE
They are from the swfObject.

My question is how do i use the function results in php (one of which is defined using vbscript the other javascript) to output results depending on the version.
In my example, i wish to output one movie when ver 8.0 and another when 6.0

cheers
steve

Code:
<script language="VBScript">

  Visual basic helper required to detect Flash Player ActiveX control version information
    Function VBGetSwfVer(i)
        on error resume next
        Dim swControl, swVersion
        swVersion = 0
        
        set swControl = CreateObject("ShockwaveFlash.ShockwaveFlash." + CStr(i))
        if (IsObject(swControl)) then
          swVersion = swControl.GetVariable("$version")
        end if
        VBGetSwfVer = swVersion
      End Function
	  document.write(VBGetSwfVer(8))
 

</script>

<script language="JavaScript" type="text/javascript">

function JSGetSwfVer(i){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
      	} else {
			flashVer = -1;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	// Can't detect in all other cases
	else {
		
		flashVer = -1;
	}
	document.write(flashVer);
}
JSGetSwfVer(6); 

</script>
__________________
www.mastech-solutions.com
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
When You Register, These Ads Go Away!
     
Reply     « Reply to using results ffrom javascript/vbscript in php
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11706 seconds with 13 queries