Jump to content

millerthegorilla

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Everything posted by millerthegorilla

  1. Hi - I am *very* new to php and am trying to insert a line of javascript into script tags in the body of an html page. Basically, I'm trying to detect the browser type and insert a flash param if the browser is firefox and a different one if not. Below is my php : function detect_transparent() { global $ff, $others; $browser = get_browser(); if($browser->browser == 'Firefox') { echo($ff); } else { echo($others); } and here is a section of the script tags in the html : <script> var so = new SWFObject('<?php swfaddress_resource('/website.swf?datasource=datasource.php'); ?>', 'website', '100%', '100%', '9,0,115,0'); <?php detect_transparent(); ?> so.addParam("allowFullScreen", "true"); ... </script> I know I could use a javascript function to do the same thing but I'd prefer to use php. The reason I'm doing it is because Firefox freaks out and takes up 99% of the processor when you use flash with wmode = transparent. The code works fine without the <?php detect_transparent(); ?> function call. Am I correct in thinking that a php function call like this gets executed server side and then the resulting html page gets passed to the client browser where the client side javascript is called? If that's right, why does this not work? Thanks in advance.
×
×
  • 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.