Forum Moderators: coopster

Message Too Old, No Replies

Image from blob and header change problem

         

sajjat

6:32 am on Mar 28, 2006 (gmt 0)

10+ Year Member



I am retriving image from blob and i have the following code....

<?
$user="root";
$host="localhost";
$pass="";
$dbname="TTCID";
$db=@mysql_pconnect($host,$user,$pass) or
die("Could not connectd to server");
mysql_select_db($dbname,$db) or
die('Could not select DB!');
$sql = "SELECT Photo FROM image WHERE custid='$id'";
if(!($result=@mysql_query($sql))) showerror;
$data=@mysql_fetch_array($result);
if (!empty($data['Photo']))
{
header("Content-Type: image/jpg");
print $data['Photo'];
print $data['Signature'];
}
?>

The problem is :
1) i cannt print both image....
2) smtime it opensa dialog box to save the file.
3) and how to change header("Content-Type: image/jpg") bcause i want to add html code in the same page.

Please help me out....

Habtom

1:04 pm on Mar 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What is the output your are getting? Any errors. The code for printing the image looks fine to me.

Habtom

coopster

3:53 pm on Mar 28, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, sajjat.

Perhaps this thread on How to convert image blob files back to image [webmasterworld.com] will offer insight.

sajjat

4:23 pm on Mar 28, 2006 (gmt 0)

10+ Year Member



thanks..

yes its printing the image.. but i cannt print more than one image...
no html code works after the image print...

coopster

5:56 pm on Mar 28, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Read further down in the thread I linked, it describes a solution you can use by embedding the image retrieval in an <img> element.