[PHP] Print text and image in the same page.

2002-12-15 Thread Naif M. Al-Otaibi
Hi all,

I try to print some information (text and image) that I retrieve from an oracle DB, 
but I got the image printed as binary junk. When I put the line that print the image 
in a  html image tag, I got a red square with X inside. What can I do to solve this 
problem?

This is my code:
--
? 
echo html;
echo headtitleRetrieve Results/title/head;
echo body bgcolor=#Fge89jbrbrbrbr;

$conn = OCILogon(*,*,*);
$query = select country,continent,population,area,language,capital,map from countries 
where country=;
$query .= '$country';
$stmt = OCIParse($conn,$query);
OCIExecute($stmt);
OCIFetchInto($stmt, $blob);

echo pbRetrieve Result:/b;
echo br;
echo b Country:/b $blob[0];
echo br;
echo b Continent:/b $blob[1];
echo br;
echo b Population:/b $blob[2];
echo br;
echo b Area:/b $blob[3];
echo br;
echo b Language:/b $blob[4];
echo br;
echo b Capital:/b $blob[5];
echo br;
echo img src=\$blob[6]-load()\;
echo /p;

OCIFreeStatement($stmt);
OCILogoff($conn);

echo /body;
echo /html;
?
---



Re: [PHP] Print text and image in the same page.

2002-12-15 Thread Chris Shiflett
--- Naif M. Al-Otaibi [EMAIL PROTECTED] wrote:
 I try to print some information (text and image) that I
 retrieve from an oracle DB, but I got the image printed
 as binary junk. When I put the line that print the image
 in a  html image tag, I got a red square with X inside.
 What can I do to solve this problem?

This is really just an HTML question. The img tag has an
attribute called src that should be given a URL as a value.
The URL should be an image. For example:

img src=http://www.php.net/gifs/php_snow.gif;

On the other hand, if you want to dump the raw image to the
browser and expect it to render it properly, you must tell
it that you are sending an image. For example:

header(Content-Type: image/gif);

Chris

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php