Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- PHP4 mime headers and CSS background-image
April 12, 2006, 1:44 pm
rate this thread
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:
$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
Now I have a need to use some of these database-archived images in CSS as
background images. For instance:
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?
Re: PHP4 mime headers and CSS background-image
It could be a file location issue; resource.php must be in the same
directory with the style sheet. Assuming this is not the case, you may
want to get rid of "./", replace a relative URL with an absolute URL,
and/or enclose the URL in quotes. Try these: