Ver Mensaje Individual
  #6 (permalink)  
Antiguo 19/04/2010, 13:41
etisdemian
 
Fecha de Ingreso: octubre-2009
Mensajes: 357
Antigüedad: 14 años, 5 meses
Puntos: 1
Respuesta: 1=(mezclar divs y tablas) 2=(imagen por defecto)

mire... el siguiente img src. muestra la imagen .

Código HTML:
Ver original
  1. <img src ="../prd/<?php echo $row[0];?>" width="104" height="125">

pero abajo, no reconoce la ruta, mostrando la imagen por default.

está mal la sintaxis de la ruta?


Código PHP:
Ver original
  1. <?php
  2.    
  3.      $path_imagen='<img src ="../prd/<?php echo $row[0];?>" width="120" height="125">';
  4.      $nopath='<img src ="../prd/header_r1_c1.jpg" width="120" height="125">';
  5.      if (file_exists($path_imagen)){
  6. echo $path_imagen;
  7. } else {
  8. echo $nopath;
  9. }  
  10. ?>

este codigo no muestra el default XD.

Código HTML:
Ver original
  1. <img src ="../prd/<?php echo (($row[0]!='')?htmlspecialchars($row[0]):'header_r1_c1.jpg');?>" width="104" height="125">


jeje.

Última edición por etisdemian; 19/04/2010 a las 13:49