Foros del Web » Programando para Internet » PHP »

imagen no imprime...

Estas en el tema de imagen no imprime... en el foro de PHP en Foros del Web. Saludos a todos y disculpen q ultimamente solo lo q hago es preguntar y no he aportado... tngo una galeria y me imprime las fotos ...
  #1 (permalink)  
Antiguo 08/08/2008, 13:21
Avatar de T4ke0veR  
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 8 meses
Puntos: 28
imagen no imprime...

Saludos a todos y disculpen q ultimamente solo lo q hago es preguntar y no he aportado... tngo una galeria y me imprime las fotos horizontalmente.. pero tngo una espacio donde extraigo una imagen y no me imprime nada

Código PHP:
<?php require('conect.php');
@
$id=$_REQUEST['id'];
$sql="SELECT * FROM galeria WHERE prod_id = $id";
$sql_exec=mysql_query($sql) or die ("Error en consulta: $sql_execex, error: "mysql_error());

// Variables de Configuración -----------------------------------
// Define el numero de Filas
$id2=$row['id'];
$n_filas=3;

//***************************************************************
$cat=$id;
//$cat=6;

$fotos = array();

$tottal=113;
// ------------------------------------------------------------------------------------------------------------------
$vert=$tottal/$n_filas;
$vert=round($vert);
?>
<link href="estilos.css" rel="stylesheet" type="text/css" />
<script language="javascript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);

}
function cambiar(ruta){
document.imgamp.src = ruta;
}
window.onload = cargar;
//-->
var loteImagenes=new Array();
    <?php
    
// Abrir un directorio conocido, y proceder a leer sus contenidos
    /*$dir = "galeria/".$fol;
    if (is_dir($dir)) {
        if ($gd = opendir($dir)) {
        $cont=0;
            while (($archivo = readdir($gd)) !== false) {
            if ($archivo != "."){
            if ($archivo != ".."){
            if ($archivo != "Thumbs.db"){
                $laf= $dir."/".$archivo;
                echo "loteImagenes[".$cont."]='".$laf."';";
                    $img[$cont] = $laf;
                    $cont=$cont+1;
        }    }    }    }
            closedir($gd);
        }
    } else {
        die( "Error fatal, $dir no es un directorio" );
    }  
    
    /*$pics = array();
    $cont=0;
    while($rowx=mysql_fetch_assoc($sql_execx)){
    echo "loteImagenes[".$cont."]='".$rowx['img]."';";
    $img[$cont] = $rowx['img'];
    $cont=$cont+1;
    }*/
    
    
?>
    var i=0;
    function anterior(){
    if(i<1){
    var NumImagen = i;
    }else{
    var NumImagen = i-=1;
    }
    document.imgamp.src = loteImagenes[NumImagen];
    }
    function siguiente(){
    if(i>loteImagenes.length-2){
    var NumImagen=i;
    }else{
    var NumImagen= i+=1;
    }
    document.imgamp.src = loteImagenes[NumImagen];
     
    
    }
    function nav(pic){
    i=pic;
    document.imgamp.src = loteImagenes[pic];
    }
    function cargar(){
    document.imgamp.src = "<?=$img[0]?>";
    }
    
    </script>
<table width="260" height="408" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center" valign="middle" bgcolor="#DCDBA0"><br />
      <table width="220" border="0" align="center" cellpadding="0" cellspacing="1">
      <tr>
        <td width="260" bgcolor="#C1AC6C"><div id="ampliar" style="margin-left:5px; margin-right:5px; margin-top:5px; margin-bottom:5px;">
         <div align="center"><img src="galeria/<?php echo $row['img']; ?>" alt="Foto Principal" name="imgamp" width="220" height="220" border="0"/></div>
        </div></td>
      </tr>
    </table>
      <br />
      <table width="220" height="64" border="0" align="center" cellpadding="0" cellspacing="2">
        <!--DWLayoutTable-->
        <tr>
          <td width="220" height="64"><table width="220" height="64" border="0" align="center" cellpadding="0" cellspacing="5">
              <?php
        $a
=0;// Colocando el contador horizontal en 0
        
$i=1;// Colocando el contador vertical en 0
        
$w=0;//Colocando un contador para el mensaje de "No hay articulos en esta acategoria"
        
            
while($row=mysql_fetch_assoc($sql_exec)){
            
$w=w+1;
                if (
$a==0){
                echo 
'<tr>';
                }
                
$a=$a+1;
                
$fotos[$i.'-'.$a] = $row['img'];
                
                echo 
"<td height='80' width='53' border='0' ><a href=# onClick=\"window.open('verimagen.php?id=".$row['id']."; ','verimagen', 'width=220,height=220'); return false;\"><img src='galeria/".$row['img']."' width='64' height='64' border='0'/></a>";
            
                
$r=$a;// contador remanente para listar imagenes sin exceso
                
                    
if ($a >= $n_filas) {
                    
$a=0;// reiniciando el contador horizontal
                    
$i=$i+1;// aumentando el contador vertical
                    
echo '</tr>';
                    } 
            if (empty(
$row)) {
        echo
"<table width='0' border='0' align='center' cellpadding='0' cellspacing='0'>
          <tr>
            <td width='257'><div align='center'>No hay articulos en esta categoria </div></td>
          </tr>
        </table>
        "
;
        break 
1;}
            
            }
            
         echo 
'</td>';
        
?>
              <?php /*if (empty($w)) {
        echo"<table width='0' border='0' align='center' cellpadding='0' cellspacing='0'>
          <tr>
            <td width='492'><div align='center'>No hay articulos en esta categoria </div></td>
          </tr>
        </table>
        ";
        exit;}
        */
?>
          </table></td>
        </tr>
      </table>
      <br /></td>
  </tr>
</table>
es la primera.. justo aqui
Código PHP:
<img src="galeria/<?php echo $row['img']; ?>" alt="Foto Principal" name="imgamp" width="220" height="220" border="0"/>
__________________
Diseño gráfico, Web, imagen corporativa, publicidad ...
  #2 (permalink)  
Antiguo 08/08/2008, 13:25
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 11 meses
Puntos: 2135
Respuesta: imagen no imprime...

Hola T4ke0veR,

De donde obtienes tu variable $row, ya que veo que la defines hasta el while, pero antes de eso no existe.

Saludos.
  #3 (permalink)  
Antiguo 08/08/2008, 14:05
Avatar de T4ke0veR  
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 8 meses
Puntos: 28
Respuesta: imagen no imprime...

si gatorv ya me fije en eso.... sorry... debe ser el agotamiento q me hace pasar de largo!!! gracias!!!
__________________
Diseño gráfico, Web, imagen corporativa, publicidad ...
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 07:14.