|
Welcome In HTML Course:-
Back
To Advanced index
Secure Your Images
You can use it make your images difficult for the
average web visitor to take from your site. Remember that this technique is not
fool proof by any means - if a user is seeing something on their screen, its on
their computer. However, using this trick will help you prevent this from
happening by fooling the typical web surfer. For a surfer to get past this
trap, they have to search though your source code to get the actual location of
the picture. This will discourage many people and confuse people that don't
understand HTML.
This trick uses the BACKGROUND="image.jpg" attribute of the <TABLE> tag. For
example, this code:
<TABLE BACKGROUND="person.gif" BORDER="0"
CELLSPACING="0" CELLPADDING="0">
<TR><TD> </TD></TR>
</TABLE>
Will make this:
Now, we have two more problems to solve. First, you can't see the whole
image. And second, when you right click on the image you still can save it in
some browsers.
To kill these two birds with one stone, we can use the clear dot gif to help
us out. This image will create a clear covering over your picture. You set the
size of this image to be exactly the same size as your real one.
This code:
<TABLE BACKGROUND="person.gif" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR><TD><IMG SRC="clear.gif" HEIGHT="140" WIDTH="200"></TD></TR>
</TABLE>
Will make this:
Now, when you try to right click on this image to save it, you get a box that
looks like you are saving the image, but you are really saving the clear cover
to your hard drive. It is impossible to download this secure image unless you
view the source of the HTML file. If you want to get more confusing, change the
name of your "clear.gif" to be "image1.gif" and then it will look even more
realistic when the browser asks where you want to save the image.
This trick is effective because visitors will try to save your image and they
will think they did it successfully and they will move on. Later, when they try
to view the downloaded image they will see a 1x1 transparent picture.
NOTE: Some older browsers do not understand the BACKGROUND attribute of the
<TABLE> tag, and the image will not appear at all. But 99% of your visitors
should be able to see the image and be fooled by this simple HTML trick.
Back
To Advanced index
|