I read everything here about it (some of this code might look familiar) but nothing seems suitable to my needs so I hope there is a way. I need to loop through the images table, pulling out one or two for presentation on various existing pages using the ID field, which is also being taken care of already in the Select statement for the loop, but all I can get is the source of the image, not the image itself. Here is what I have - there is already a database connection and this is already inside a loop, and the variables for $image are already declared:
[tt]$mime = array("JFIF" => "jpeg",
"GIF89" => "gif"
if ($image != '') {
$content = base64_decode($image);
while(list($key,$val) = each($mime)) {
if(ereg($key,$content)) {
$mime_type = $val;
}
}
$image = "<img src=\"" . $content . "." . $mime_type . "\">";
}[/tt]
I think what I need to do is in the loop, to actually create a physical temp copy of the image somewhere in a temp folder and then after it's presented, to delete it again but I am not sure how to do that. Any ideas? Don
don@pc-homepage.com
Experienced in HTML, Perl, VBScript, PWS, IIS and Apache. Run OS/2 Warp 4, BeOS v5 and Windows NT/2000 (only when I have to!)
[tt]$mime = array("JFIF" => "jpeg",
"GIF89" => "gif"
if ($image != '') {
$content = base64_decode($image);
while(list($key,$val) = each($mime)) {
if(ereg($key,$content)) {
$mime_type = $val;
}
}
$image = "<img src=\"" . $content . "." . $mime_type . "\">";
}[/tt]
I think what I need to do is in the loop, to actually create a physical temp copy of the image somewhere in a temp folder and then after it's presented, to delete it again but I am not sure how to do that. Any ideas? Don
don@pc-homepage.com
Experienced in HTML, Perl, VBScript, PWS, IIS and Apache. Run OS/2 Warp 4, BeOS v5 and Windows NT/2000 (only when I have to!)