Hi All,
I'm trying to call a file and pass few arguments so it will repond with the right syntax. I can't execute the SWITCH statement!
It always defaults.
How can I pass the argument?
///////////The calling Code (driver):
echo "<IMG SRC=\"thumbnail.php?Id=$ImageId[0]&&ThumbnailBackgroundColor=1\" width=65 height=65 border=0></a>";
////////The page being called (thumbnail.php):..
thumbnail.php
...
switch($ThumbnailBackgroundColor)
{
case 1 :
{
// Green Highlight! bgcolor=\"#66FFFF\"
$sql = "SELECT ImageMediumShowRoomGreenHilite FROM Images WHERE Id=$Id";
}
case 2 :
{
// White Background! bgcolor=\"#FFFFFF\"
$sql = "SELECT ImageMediumShowRoomWhite FROM Images WHERE Id=$Id";
}
case 3 :
{
// Grey Background! bgcolor=\"#E8E8E8\"
$sql = "SELECT ImageMediumShowRoomGrey FROM Images WHERE Id=$Id";
}
default :
{
$sql = "SELECT ImageMediumShowRoomGreenHilite FROM Images WHERE Id=$Id";
// $sql = "SELECT Images.ImageMediumGalleryBlack FROM Images WHERE Id=$Id";
}
}
$res = dbi_query ( $sql );
if ( $res )
{
if( $row = dbi_fetch_row ( $res ) )
{
Header("Content-type: image/jpeg");
echo $row[0];
}
dbi_free_result ( $res );
}
-Alon
js@wsco.com