Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/11/2002, 13:56
Avatar de Chuty
Chuty
 
Fecha de Ingreso: noviembre-2002
Ubicación: el bar de la esquina
Mensajes: 609
Antigüedad: 21 años, 5 meses
Puntos: 2
Crear imagen desde una URL ?? Ayudaa

Buenas a todos
tengo una base de datos con imagenes png en formato binario, y las voy tomando segun la consulta que realize.
Pero como a las imagenes las tengo que manipular, tengo que poder crear la imagen atravez de una URL.

desde este codigo creo la imagen ** img_bd2000.php **
<?php
$id = "$recno";
$ServerName = "MIserver";

$StringQuery = "select * from mibase_cli where cql_recno=$id";
$ConnectServerID = odbc_connect( $ServerName, sa, sa);

if( $ConnectServerID ) {
$ResultQueryID = odbc_do( $ConnectServerID, $StringQuery);
if( $ResultQueryID > 0 ) {
$datrec = odbc_result( $ResultQueryID, "dat_rec");
header("Content-type: image/png");
echo $datrec ;
}
odbc_free_result( $ResultQueryID );
odbc_close( $ConnectServerID );
}
?>

desde otro codigo intento recuperar la imagen pero me da error

<?php
$recno=14;
include("./phptest/img_bd2000.php");
$imgURL = '(http://crhwnt08/phptest/img_bd2000.php?recno=14)';
$imagen = imagecreatefrompng( $imgURL );
echo "<IMG SRC='$imagen'>";
?>
------------------------error--------------------------------
Warning: Failed opening './phptest/img_bd2000.php' for inclusion (include_path='.;c:\php4\pear') in c:\inetpub\wwwroot\phptest\url_test.php on line 4

Warning: imagecreatefrompng: Unable to open '(http://crhwnt08/phptest/img_bd2000.php?recno=14)' for reading in c:\inetpub\wwwroot\phptest\url_test.php on line 8
---------------------------------------------------------------

Hay alguna forma en que pueda resolver el tema.
Desde ya muchas gracias por los aportes . Salu2