Ver Mensaje Individual
  #2 (permalink)  
Antiguo 15/01/2009, 14:18
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años, 8 meses
Puntos: 2135
Respuesta: Mostrar imagen alternativa del servidor si no hay imagen

Lee la sintaxis básica de PHP, tu problema es al meterlas dentro del echo, y la regla es si solo vas a imprimir mejor cierra el bloque PHP (?>) imprime el HTML, luego abre el bloque PHP e imprimes lo demas.

Algo asi:
Código php:
Ver original
  1. <table width='100%' border='0' cellpadding='0' cellspacing='0' class='style1'>
  2. <tr>
  3. <td width='14%'><div align='center'>
  4. <?php
  5. if (empty($foto))
  6. {
  7. echo '<img src="http://bajabloggers.com/anuncios/imagenes/planeta-clasificados.gif">';
  8. }
  9. else
  10. {
  11. //echo "<img src='anuncios/imagenes/".$foto."' width='90' height='68' border='1'>";
  12. echo"<a href='anuncios/imagenes/".$foto."' rel='lightbox'><img src='anuncios/imagenes/".$foto."' width='90' height='68' border='0' ></a>";
  13. }
  14. ?></div></td> </tr>
  15. </table>

Saludos