You are here: PHP4 mime headers and CSS background-image « PHP Programming Language « IT news, forums, messages
PHP4 mime headers and CSS background-image

Posted by Littlefire on 04/12/06 16:44

Hi all

I wrote a proxy script that fetches images out of a database and sends the
data to the browser, using the Content-type header. For instance, if I'm
loading a jpg image from the database, the script's output will be:

header("Content-type: image/jpeg");
header("Content-length: <filesize-goes-here>");
print $imagedata;

$imagedata then obviously contains the binary image data that was in a blob
field in the database.

All that works surprisingly swell when I call the script with something
like:

<img src='resource.php?name=thejpegfile.jpg'>

Now I have a need to use some of these database-archived images in CSS as
background images. For instance:

#menu {
background-image: url(./resource.php?name=thejpegfile.jpg);
}

However, that refuses to work, I'm left without the background image
although the rest of the page displays fine.

Any ideas why the db proxy script would work when called from HTML but not
when called from CSS?

Thanks,
:A

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация