vineet
10-29-2008, 01:09 PM
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
<?php
$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
<?php
$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='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='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
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
<?php
$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
<?php
$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='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='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