Solved

how can i embed an .swf file using php?

Posted on 2008-06-14
5
5,921 Views
Last Modified: 2013-12-13
i have this php file that calls the name of a .swf file that is stored in a db.  i am trying to embed the .swf using the following code, but all i get is a white box in place of the actual .swf...am i doing somethign incorrectly?
<?php 
 

echo "<script src='AC_RunActiveContent.js' type='text/javascript'></script>";
 

// Recieving the variables. 

$performerName = $_GET["performerName"]; 
 

include 'dbconfig.php';
 

mysql_select_db($dbname) or die("Error connecting to video database");
 
 

$query =  mysql_query ("SELECT * FROM tour WHERE id = 10") or die ('Error: '.mysql_error ());
 

while ($row = mysql_fetch_assoc($query)){
 

echo "<script type='text/javascript'>";
 

echo "AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','300','height','169','src','assets/indexmenu/menu','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','".$row['trailerserverpath'].$row['trailer']."' );";
 

echo "</script><noscript><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='300' height='169'>";
 

echo "<param name='movie' value=".$row['trailerserverpath'].$row['trailer'].$row['extension']."/>";

echo "<param name='quality' value='high' />";
 

echo  "<embed src=".$row['trailerserverpath'].$row['trailer'].$row['extension']." quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='300' height='169'></embed>";
 

echo "</object></noscript>";
 

echo $row['trailerserverpath'].$row['trailer'].$row['extension'];
 

}

?>

Open in new window

0
Comment
Question by:nooch44
  • 3
5 Comments
 
LVL 2

Expert Comment

by:pain_is_relative
ID: 21787646
hmmmm..

what is the resultant out put. Could you attach a copy of that. (the generated source of the outputed web page).
0
 

Author Comment

by:nooch44
ID: 21788623
here is what gets generated in the 'view source'
<div class="tourBox">

<script type='text/javascript'>AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','300','height','169','src','assets/indexmenu/menu','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','assets/trailers/060728apsctrailer' );</script><noscript><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='300' height='169'><param name='movie' value=assets/trailers/060728apsctrailer.swf/><param name='quality' value='high' /><embed src=assets/trailers/060728apsctrailer.swf quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='300' height='169'></embed></object></noscript>assets/trailers/060728apsctrailer.swf

</div>

<div class="tourButtonsContainer"><img src="assets/images/download.png" alt="download trailer" width="169" height="50" />

<img src="assets/images/getfullaccess.png" alt="get full access" width="169" height="50" /></div>

</div>

Open in new window

0
 

Author Comment

by:nooch44
ID: 21788642
i just notice in the output that the sinlge quote ( ' ) marks are not showing up around the .swf name...also there are no line breaks...can this be an issue?
0
 

Accepted Solution

by:
nooch44 earned 0 total points
ID: 21799286
the single quote mark did the trick...the breaks had no bearing on it...thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now