alexguz79 Posted March 24, 2008 Share Posted March 24, 2008 hey everybody.... this is it.. im trying to load an swf file stored in my database with this code: <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="555" height="500"> <param name="movie" value="<?=$row['swf_evento']?>" /> <param name="quality" value="high" /> <embed src="<?=$row['swf_evento']?>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="555" height="500"></embed> </object> the thing is... on the site i just get the binary code..... can somebody hellp me with this Link to comment https://forums.phpfreaks.com/topic/97559-problem-loading-swf-from-mysql-please-help/ Share on other sites More sharing options...
teng84 Posted March 24, 2008 Share Posted March 24, 2008 what are the data that you get from your data base? I supposed its only the file name of your flash file Link to comment https://forums.phpfreaks.com/topic/97559-problem-loading-swf-from-mysql-please-help/#findComment-499163 Share on other sites More sharing options...
alexguz79 Posted March 24, 2008 Author Share Posted March 24, 2008 its an swf file.... ****.swf is stored in my database Link to comment https://forums.phpfreaks.com/topic/97559-problem-loading-swf-from-mysql-please-help/#findComment-499166 Share on other sites More sharing options...
cooldude832 Posted March 24, 2008 Share Posted March 24, 2008 you need to make a secondary file that is the psedo .swf file your part right there becomes <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="555" height="500"> <param name="movie" value="movie.php?id=<?php echo $movie_id;?>" /> <param name="quality" value="high" /> <embed src="<?=$row['swf_evento']?>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="555" height="500"></embed> </object> Then make a new file called movie.php that is sorta like <?php connectSQL(); if(is_int($_GET['id'])){ $q = "Select swf_evento as data from `table` where Movie_ID = ".mysql_real_escape_string($_GET['id']); $r = mysql_query($q) or die(mysql_error()."<br /><br />".$q); header("content-type: application/x-shockwave-flash"); list($data) = mysql_fetch_assoc($r); echo $data; ?> That should be the general idea to it this isn't working code out pseudo out php. Link to comment https://forums.phpfreaks.com/topic/97559-problem-loading-swf-from-mysql-please-help/#findComment-499167 Share on other sites More sharing options...
alexguz79 Posted March 24, 2008 Author Share Posted March 24, 2008 that from cooldude didnt work eather... any ideas?? im stuck Link to comment https://forums.phpfreaks.com/topic/97559-problem-loading-swf-from-mysql-please-help/#findComment-499177 Share on other sites More sharing options...
cooldude832 Posted March 24, 2008 Share Posted March 24, 2008 that from cooldude didnt work eather... any ideas?? im stuck It will work if the movie.php file is constructed properly. You should be able to point to movie.php?id=5 and get the 5th movie to play Link to comment https://forums.phpfreaks.com/topic/97559-problem-loading-swf-from-mysql-please-help/#findComment-499179 Share on other sites More sharing options...
alexguz79 Posted March 24, 2008 Author Share Posted March 24, 2008 this is the error i get with that: Parse error: syntax error, unexpected $end in /home/mytrende/public_html/picture_movie.php on line 9 and line 9 is the end of the code.... i dont get it Link to comment https://forums.phpfreaks.com/topic/97559-problem-loading-swf-from-mysql-please-help/#findComment-499182 Share on other sites More sharing options...
cooldude832 Posted March 24, 2008 Share Posted March 24, 2008 I don't see an error on line 9 oh wait I don't see line 9! (Post your code) Link to comment https://forums.phpfreaks.com/topic/97559-problem-loading-swf-from-mysql-please-help/#findComment-499183 Share on other sites More sharing options...
alexguz79 Posted March 24, 2008 Author Share Posted March 24, 2008 thats what i see too this is the code <?php connectSQL(); if(is_int($_GET['id'])){ $q = "Select swf_evento as data from `perfect` where id = ".mysql_real_escape_string($_GET['id']); $r = mysql_query($q) or die(mysql_error().$q); header("content-type: application/x-shockwave-flash"); list($data) = mysql_fetch_assoc($r); echo $data; ?> Link to comment https://forums.phpfreaks.com/topic/97559-problem-loading-swf-from-mysql-please-help/#findComment-499184 Share on other sites More sharing options...
cooldude832 Posted March 24, 2008 Share Posted March 24, 2008 you don't close the if <?php connectSQL(); if(is_int($_GET['id'])){ $q = "Select swf_evento as data from `perfect` where id = ".mysql_real_escape_string($_GET['id']); $r = mysql_query($q) or die(mysql_error().$q); header("content-type: application/x-shockwave-flash"); list($data) = mysql_fetch_assoc($r); echo $data; } ?> Link to comment https://forums.phpfreaks.com/topic/97559-problem-loading-swf-from-mysql-please-help/#findComment-499187 Share on other sites More sharing options...
ohdang888 Posted March 24, 2008 Share Posted March 24, 2008 are you using firefox? mozilla browsers don't use the classid or codebase. it messes them up. Link to comment https://forums.phpfreaks.com/topic/97559-problem-loading-swf-from-mysql-please-help/#findComment-499195 Share on other sites More sharing options...
alexguz79 Posted March 24, 2008 Author Share Posted March 24, 2008 im using both... firefo and explorer..... i thing we're getting there.... now my page recognize is a swf that has to display.... the thing is... it's not displaying the swf on the database... again... here's the code... million thanx in advance this is where should display the swf file ---------------------------- <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="555" height="500"> <param name="movie" value="picture_movie.php?id=<?php echo $id;?>"> <param name="quality" value="high"> <embed src="picture_movie.php?id=<?php echo $id;?>" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="555" height="500"></embed> </object> ---------------------------- this is the file picture_movie.php ---------------------------- <?php require_once('config_picture.php'); if(is_int($_GET['id'])){ $q = "Select swf_evento as data from `perfect` where id = ".mysql_real_escape_string($_GET['id']); $r = mysql_query($q) or die(mysql_error().$q); header("content-type: application/x-shockwave-flash"); list($data) = mysql_fetch_assoc($r); echo $data; } ?> ---------------------------- Link to comment https://forums.phpfreaks.com/topic/97559-problem-loading-swf-from-mysql-please-help/#findComment-499207 Share on other sites More sharing options...
alexguz79 Posted March 24, 2008 Author Share Posted March 24, 2008 anyone please Link to comment https://forums.phpfreaks.com/topic/97559-problem-loading-swf-from-mysql-please-help/#findComment-499226 Share on other sites More sharing options...
cooldude832 Posted March 24, 2008 Share Posted March 24, 2008 when picture_movie.php has a valid ID what does it do if you open it??? Not embeded, but on its own and view its source code. Also check what the header should be for a .swf file I just pulled that from what u had. Link to comment https://forums.phpfreaks.com/topic/97559-problem-loading-swf-from-mysql-please-help/#findComment-499368 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.