[SWFObject] Using PHP with SWFObj

Matt S. mattspieg at gmail.com
Fri Dec 8 08:20:42 PST 2006


HI,
so I'm trying to integrate SWFObject into a Wordpress blog, and it's
been going fine, except for in IE (imagine that). I have the following
content:

<!--start flash header-->
		<div id="flashcontent">
		<?php bloginfo('name'); ?>	
		</div>

	<script type="text/javascript">
		// <![CDATA[
		
		var so = new SWFObject("http://www.someurl.com/dir/flashheader.swf",
"header", "564", "150", "8", "#000000");
		so.addParam("scale", "noscale");
		 so.addVariable("hdrtext", "<?php bloginfo('name'); ?>");
		so.write("flashcontent");
		
		// ]]>
	</script>

<!--end flash header-->


And its working great, its passing in the blog name as a variable, but
the problem is that in IE  6 and older, the "<?php bloginfo('name');
?>" thats in "flashcontent", and should be appearing only if flash
isnt present, is getting processed anyway, so what you end up with is
the flash object generated, but then under it the content generated by
the php gets inserted as well.

The basic goal is that if flash is present, show the flash, and if its
not, run the PHP as Wordpress normally would. In this case though, in
IE 6, its doing both.

Any suggestions much appreciated,

thanks!

.m



More information about the Swfobject mailing list