use IMG to display image but shows garbage
dear all,
how output dynamic images along html php scripts.
it ends looking bunch of garbage.
i pass picture number following php pgm , asume display picture. however, shows lot of garbage. parameters pass php pgm should ok.
please help.
many thanks.
<?php require_once('connections/abc.php'); ?>
<?php
$colname_recordset1 = "-1";
if (isset($_get['id'])) {
$colname_recordset1 = (get_magic_quotes_gpc()) ? $_get['id'] : addslashes($_get['id']);
}
mysql_select_db($database_abc, $abc);
$query_recordset1 = sprintf("select * replyarticle postid = %s", $colname_recordset1);
$recordset1 = mysql_query($query_recordset1, $abb) or die(mysql_error());
$row_recordset1 = mysql_fetch_assoc($recordset1);
$totalrows_recordset1 = mysql_num_rows($recordset1);
?>
<!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">
<head>
<meta http-equiv="content-type" content="text/html; charset=" />
<title>untitled document</title>
</head>
<body>
<?php
$img= $row_recordset1['book_no']; ?>
<?php
$img_name=$img;
header("content-type: image/jpeg");
list($w,$h)=getimagesize($img_name);
$src_img=imagecreatefromjpeg($img_name);
imagejpeg($src_img);
imagedestroy($src_img);
mysql_free_result($recordset1);
?>
</body>
</html>
how output dynamic images along html php scripts.
it ends looking bunch of garbage.
i pass picture number following php pgm , asume display picture. however, shows lot of garbage. parameters pass php pgm should ok.
please help.
many thanks.
<?php require_once('connections/abc.php'); ?>
<?php
$colname_recordset1 = "-1";
if (isset($_get['id'])) {
$colname_recordset1 = (get_magic_quotes_gpc()) ? $_get['id'] : addslashes($_get['id']);
}
mysql_select_db($database_abc, $abc);
$query_recordset1 = sprintf("select * replyarticle postid = %s", $colname_recordset1);
$recordset1 = mysql_query($query_recordset1, $abb) or die(mysql_error());
$row_recordset1 = mysql_fetch_assoc($recordset1);
$totalrows_recordset1 = mysql_num_rows($recordset1);
?>
<!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">
<head>
<meta http-equiv="content-type" content="text/html; charset=" />
<title>untitled document</title>
</head>
<body>
<?php
$img= $row_recordset1['book_no']; ?>
<?php
$img_name=$img;
header("content-type: image/jpeg");
list($w,$h)=getimagesize($img_name);
$src_img=imagecreatefromjpeg($img_name);
imagejpeg($src_img);
imagedestroy($src_img);
mysql_free_result($recordset1);
?>
</body>
</html>
hi,
the code using looks correct!
first confirm type of field in mysql stores images longblob , try save fetched image @ on server , use img src tag show it.
even if not show image encrypted data mean there problem while saving images in mysql table.
hope helps!
cheers,
~maneet
lexolution services
web development company
the code using looks correct!
first confirm type of field in mysql stores images longblob , try save fetched image @ on server , use img src tag show it.
even if not show image encrypted data mean there problem while saving images in mysql table.
hope helps!
cheers,
~maneet
lexolution services
web development company
More discussions in Dreamweaver support forum
adobe
Comments
Post a Comment