Protect, prevent, stop people from steal images on your site

 
Post new topic   Reply to topic    Webmaster Forum -> Programming Languages -> Javascript
script
Guest




Gender: None specified

PostPosted: Fri Jul 06, 2007 4:04 am    Post subject: Protect, prevent, stop people from steal images on your site
View Single PostView Single Post

* Protect, prevent, stop people from steal images on your site


Copy the code bellow and save file as -> anti_steal_image.js

                                 
Code:
var clickmessage="Don't steal my images, ok!!!."

function disableclick(e) {
if (document.all) {
if (event.button==2||event.button==3) {
if (event.srcElement.tagName=="IMG"){
alert(clickmessage);
return false;
}
}
}
else if (document.layers) {
if (e.which == 3) {
alert(clickmessage);
return false;
}
}
else if (document.getElementById){
if (e.which==3&&e.target.tagName=="IMG"){
alert(clickmessage)
return false
}
}
}

function associateimages(){
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick;
}

if (document.all||document.getElementById)
document.onmousedown=disableclick
else if (document.layers)
associateimages()




Then copy the code below to your website or the page that you want to protect and prevent people from steal your images. (the code bellow call the file anti_steal_image.js). You can add it in/between the <head> and </head> tags

                                 
Code:
<script language='JavaScript' scr='anti_steal_image.js'></script>


Besure to check the directory where it links to the file anti_steal_image.js
                                 
Code:
scr="anti_steal_image.js'


All done, You can change this text line if you want -> Don't steal my images, ok!!!.
 
ADs
robot
plhs09
Guest




Gender: None specified

PostPosted: Fri Jul 06, 2007 4:45 am    Post subject: : Protect, prevent, stop people from steal images on your site
View Single PostView Single Post

I did the same thing to protect my web page, but you really can't stop all people from viewing source.
 
soho
Experienced Talker
Experienced Talker


Joined: 28 Dec 2007
Posts: 30
Gender: None specified

PostPosted: Fri Dec 28, 2007 3:07 am    Post subject: : Protect, prevent, stop people from steal images on your site
View Single PostView Single Post

That is a great information for me. I am not a computer expert, anywhere I will definitely try it out.
As plhs09 mention, we can't totally stop. Some hackers still able to crack into your site.  Sad
 
luckymurari
Experienced Talker
Experienced Talker


Joined: 02 Mar 2008
Posts: 81
Gender: None specified

PostPosted: Mon Mar 03, 2008 1:36 pm    Post subject: : Protect, prevent, stop people from steal images on your site
View Single PostView Single Post

Yaa,still it's not the best way.Only thing you can revent is hotlinking of yur images
 
Display posts from previous:   
Post new topic   Reply to topic All times are GMT
Page 1 of 1