PDA

View Full Version : Setting images from a mysql db as background images


NerdArmy
11-16-2011, 07:14 PM
I have a simple question. How do you set mysql image results as background images. I already know how to display images from a mysql db so know need to explain that process. I also know how to set images as backgrounds using css. However setting mysql results as background images is a different process. I need to know this because I'm creating a image gallery and I don't want people dragging images off the page, thanks in advance.

edbr
11-18-2011, 06:56 AM
not sure , it may be possible if the style is on the page (ie in the head> but it wont stop them if they use view background image

domedia
11-18-2011, 12:51 PM
Just like you display the result from mysql in <IMG> tags, now insert them as background images.

<element style="background: url(path/file.jpg)">

This will not stop people from copying your images though. In order to show it on a users monitor, it has to be downloaded to their computer. But that is another discussions I guess.

.

NerdArmy
11-22-2011, 11:27 PM
I know it won't stop them from copping my images I just want to make it a little harder. Thanks for the reply.