Jump to content

How to toggle with flash swf and jpg image


vinpkl

Recommended Posts

hi all

 

I have to scripts. One script displays the image and other script displays swf file. But both the image and swf are to displayed at the same location. so i want to toggle them.

If the user uploads an image then image should displayed as image, else if the user uploads an swf file then the swf file should be displayed.

 

here is my script that displays image

$qry="select * from special_offers where location='right side'";	
$result = mysql_query($qry);			  
if(mysql_num_rows($result)>0)
{
	while($row=mysql_fetch_array($result))
	{

	echo "<td>". "<img height=200 width=250 src='uploads/" . $row['offer_image'] . "'/>" . "</td>";

	}
}

 

Here is my script that displays swf file

$qry="select * from special_offers where location='right side'";	
$result = mysql_query($qry);			  
if(mysql_num_rows($result)>0)
{
	while($row=mysql_fetch_array($result))
	{

	echo "<td>"; 
	echo "<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='250' height='200'>";
  echo "<param name='movie' value='admin/uploads/" . $row['offer_image'] ."'/>";
  echo "<param name='quality' value='high' />";
  echo "<embed quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer'   type='application/x-shockwave-flash' width='250' height='200'  src='admin/uploads/" . $row['offer_image']."'>" . "</embed>";
echo "</object>";
	echo "</td>";

	}
}


 

how can i toggle them. i dont want to detect flash player. just display the image or swf according to the user input.

 

vineet

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.