harmanUK Posted July 21, 2008 Share Posted July 21, 2008 Hello, im trying to do this with PHP, if their is another way please let me know. Basicly, i want the script to load a flash file based on what id is entered, for example. user enters http://yourdomain.com/index.php?id=456 I want it to load the flash file named 456.swf Can anyone help me? This is what i have, im a total n00b to PHP. <?php $id = $_GET['id']; $width = "100"; $width = "100"; function flashembed($id, $width, $height) { $swfdir = "http://yourdomain.co.uk/scripts/upload"; echo "<tr><td><OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" WIDTH=$width HEIGHT=$height> <PARAM NAME=movie VALUE=\"$swfdir/$id.swf\"> <PARAM NAME=quality VALUE=high> <PARAM NAME=menu VALUE=false> <EMBED src=\"$swfdir/$id.swf\" quality=high WIDTH=$width HEIGHT=$height TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" menu=\"false\"></EMBED> </OBJECT></tr></td><br>"; } echo $id; ?> Note: I have changed to yourdomain.co.uk for privacy reasons. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/115777-solved-dynamic-flash-content/ Share on other sites More sharing options...
MasterACE14 Posted July 21, 2008 Share Posted July 21, 2008 try... <?php $id = $_GET['id']; $width = "100"; $height = "100"; function flashembed($id, $width, $height) { $swfdir = "http://yourdomain.co.uk/scripts/upload"; echo <<<_FLASH <tr><td><OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" WIDTH={$width} HEIGHT={$height}> <PARAM NAME=movie VALUE=\"{$swfdir}/{$id}.swf\"> <PARAM NAME=quality VALUE=high> <PARAM NAME=menu VALUE=false> <EMBED src=\"{$swfdir}/{$id}.swf\" quality=high WIDTH={$width} HEIGHT={$height} TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" menu=\"false\"></EMBED> </OBJECT></tr></td><br> _FLASH; } flashedembed($id,$width,$height); ?> Regards ACE Quote Link to comment https://forums.phpfreaks.com/topic/115777-solved-dynamic-flash-content/#findComment-595202 Share on other sites More sharing options...
harmanUK Posted July 21, 2008 Author Share Posted July 21, 2008 Solved. Quote Link to comment https://forums.phpfreaks.com/topic/115777-solved-dynamic-flash-content/#findComment-595209 Share on other sites More sharing options...
blueman378 Posted July 21, 2008 Share Posted July 21, 2008 you may want to check if $_GET['id'] is numeric or not Quote Link to comment https://forums.phpfreaks.com/topic/115777-solved-dynamic-flash-content/#findComment-595316 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.