pra você ter uma idéia do q to querendo dizer vou postar meu script ... fotos.php
<html>
<head>
<title>Documento sem título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language=JavaScript>
<!--
<!--
function click()
{
if (event.button==2)
{
alert('Quer comprar esta FOTO? aa@ibalada.com')
}
}
document.onmousedown=click
// -->
//-->
</SCRIPT>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<TABLE height=350 cellSpacing=0 cellPadding=0 width=621 border=0>
<TBODY>
<TR>
<TD height=274 valign="top"> <DIV align=center> </DIV>
<DIV align=center><IFRAME name=cima
src="foto_cima.php?id=<? $linha[idfoto] ?>" frameBorder=0
width=630 scrolling=no height=333></IFRAME></DIV></TD>
</TR>
<TR>
<TD height=55>
<TABLE height=55 cellSpacing=0 cellPadding=0 width=623 border=0>
<TBODY>
<TR>
<TD width=622 background=imagens/barra_filme.jpg
height=10></TD>
</TR>
<TR>
<TD> <div align="center">
<? $conexao = mysql_connect("localhost","root","") or print mysql_error();
mysql_select_db("balada",$conexao) or print mysql_error();
$sql = "SELECT * FROM fotos WHERE evento='$_GET[evento]'";
$exe = mysql_query($sql,$conexao) or print mysql_error();
while ($linha = mysql_fetch_array($exe)){
$foto = $linha["foto"];
echo "<a href='foto_cima.php?id=$linha[idfoto]' target='cima' ><img src='$foto' border='0' width='73' height='47' onclick='comentarios.php?idfoto=$linha[idfoto]' target='comentarios'></a> ";
} ?>
</div></TD>
</TR>
<TR>
<TD width=622 background=imagens/barra_filme.jpg
height=10></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
</TBODY>
</TABLE>
</body>
</html>
foto_cima.php
<html>
<head>
<title>Documento sem título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<TABLE width=388 height=305 border=0 cellPadding=0 cellSpacing=0 dwcopytype="CopyTableRow">
<TBODY>
<TR>
<TD width="67%" height=305 valign="top">
<DIV align=center>
<TABLE cellSpacing=0 cellPadding=0 width="79" border=0>
<TBODY>
<TR>
<TD vAlign=top align=left width="2%"
background=foto_comentario_arquivos/caixa_borda_top.jpg
height=1><IMG height=17
src="imagens/caixa_borda_top_esq.jpg" width=7></TD>
<TD width="88%"
background=imagens/caixa_borda_top.jpg><IMG
height=17 src="imagens/fotos.jpg" width=178></TD>
<TD vAlign=top align=right width="10%"
background=foto_comentario_arquivos/caixa_borda_top.jpg><IMG
height=17 src="imagens/caixa_borda_top_dir.jpg"
width=7></TD>
</TR>
<TR>
<TD vAlign=top align=left
background=imagens/caixa_borda_esq.jpg
height=242><IMG height=17
src="imagens/caixa_borda_esq.jpg" width=7><BR> <IMG
height=17 src="imagens/caixa_borda_esq.jpg"
width=7><BR> <IMG height=17
src="imagens/caixa_borda_esq.jpg" width=7><BR> <IMG
height=17 src="imagens/caixa_borda_esq.jpg"
width=7> </TD>
<TD bgColor=#666666> <DIV align=center><?
$id = $_GET["id"];
$conexao= mysql_connect("localhost","root","") or print mysql_error();
mysql_select_db("balada",$conexao) or print mysql_error();
$sql= "SELECT * FROM fotos WHERE idfoto='$_GET[id]' OR evento='$_GET[evento]'";
$exe= mysql_query($sql,$conexao) or print mysql_error();
while ($linha= mysql_fetch_array($exe)){
$foto = $linha["foto"];
echo "<div align='center'><img src='$foto' border='0' width='380' height='285'></div>";
?> </DIV></TD>
<TD vAlign=top align=right
background=imagens/caixa_borda_dir.jpg><IMG
height=17 src="imagens/caixa_borda_dir.jpg"
width=7><BR> <IMG
height=17 src="imagens/caixa_borda_dir.jpg"
width=7> <BR> <IMG
height=17 src="imagens/caixa_borda_dir.jpg"
width=7> <BR> <IMG
height=17 src="imagens/caixa_borda_dir.jpg"
width=7> </TD>
</TR>
<TR>
<TD vAlign=top align=left
background=foto_comentario_arquivos/caixa_borda_inf.jpg
height=1><IMG height=11
src="imagens/caixa_borda_inf_esq.jpg" width=7></TD>
<TD background=imagens/caixa_borda_inf.jpg></TD>
<TD vAlign=top align=right
background=foto_comentario_arquivos/caixa_borda_inf.jpg><IMG
height=11 src="imagens/caixa_borda_inf_dir.jpg"
width=7></TD>
</TR>
</TBODY>
</TABLE>
</DIV></TD>
<TD vAlign=top width="33%" bgColor=#000000> <TABLE borderColor=#000000 height=254 cellSpacing=0 cellPadding=0
width="100%" bgColor=#000000 border=1>
<TBODY>
<TR>
<TD height="252">
<TABLE cellSpacing=0 cellPadding=0 width="228" border=0>
<TBODY>
<TR>
<TD vAlign=top align=left width="1%"
background=foto_comentario_arquivos/caixa_borda_top.jpg
height=1><IMG height=17
src="imagens/caixa_borda_top_esq.jpg"
width=7></TD>
<TD width="95%"
background=imagens/caixa_borda_top.jpg><IMG
height=17 src="imagens/COMENTARIOS.jpg"
width=178></TD>
<TD vAlign=top align=right width="4%"
background=foto_comentario_arquivos/caixa_borda_top.jpg><IMG
height=17
src="imagens/caixa_borda_top_dir.jpg"
width=7></TD>
</TR>
<TR>
<TD vAlign=top align=left
background=imagens/caixa_borda_esq.jpg
height=222><IMG height=17
src="imagens/caixa_borda_esq.jpg" width=7><BR> <IMG height=17
src="imagens/caixa_borda_esq.jpg" width=7><BR> <IMG height=17
src="imagens/caixa_borda_esq.jpg" width=7><BR> <IMG height=17
src="imagens/caixa_borda_esq.jpg" width=7> </TD>
<TD bgColor=#666666><table width="209" height="209" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="209" height="209" valign="top" background="imagens/fundo_coment.jpg">
<? } include("coment.php"); ?>
</td>
</tr>
</table></TD>
<TD vAlign=top align=right
background=imagens/caixa_borda_dir.jpg><IMG height=17
src="imagens/caixa_borda_dir.jpg"
width=7><BR> <IMG height=17
src="imagens/caixa_borda_dir.jpg"
width=7><BR> <IMG height=17
src="imagens/caixa_borda_dir.jpg"
width=7><BR> <IMG height=17
src="imagens/caixa_borda_dir.jpg"
width=7></TD>
</TR>
<TR>
<TD vAlign=top align=left
background=foto_comentario_arquivos/caixa_borda_inf.jpg
height=11><IMG height=11
src="imagens/caixa_borda_inf_esq.jpg"
width=7></TD>
<TD
background=imagens/caixa_borda_inf.jpg></TD>
<TD vAlign=top align=right
background=foto_comentario_arquivos/caixa_borda_inf.jpg><IMG
height=11
src="imagens/caixa_borda_inf_dir.jpg"
width=7></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
</TBODY>
</TABLE>
<DIV align=center><IMG height=51
src="imagens/album_email.jpg" width=173 useMap=#Map
border=0> </DIV></TD>
</TR>
</TBODY>
</TABLE>
</body>
</html>
eu to achando q é somente erro de logica