Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/03/2011, 06:33
victorfz
 
Fecha de Ingreso: abril-2002
Mensajes: 186
Antigüedad: 22 años
Puntos: 2
Probrema insertando imagenes blob y header ("Content-Type: image/jpeg")

Estoy intentando mostrar en el navegador HTML e imagenes directamente de la BD (campos blob)
no puedo mostrar texto y html de forma simultanea (o fotos o HTML) debo de tener un fallo en el header("Content-Type: text/html"); pero no caigo.
Alguien ve el fallo?
Un saludo



Código PHP:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <meta name="author" content="TBSOFT" />

    <title>Sin título 8</title>
</head>

<body>
hola<br />
<?php
$link 
mysql_connect('localhost''root''');
if (!
$link)
die(
'Error al conectarse con MySQL: ' mysql_error().' <br>Número del error: '.mysql_errno());
if (! @
mysql_select_db("pruebas",$link))
{
    echo 
"No se pudo conectar correctamente con la Base de datos";
    exit();
}

$registrosmysql_query("SELECT * FROM imagenes_blob ");
while(
$lineamysql_fetch_array($registros))
{
    
header("Content-Type: image/jpeg");
    echo 
$linea['Imagen'];
    
header("Content-Type: text/html");
    echo 
' - '.$linea['Id'];
    echo 
' - '.$linea['Nombre'];
    echo 
' - '.$linea['Descripcion']."<br />";
}


?>
caracola
</body>
</html>