I have a code snippet someone posted in a forum that is supposed to prevent right-click saving of images in the browser. Its in Java. Can anyone see if it looks okay as I am not Java-fluent.
Secondly, I have server generated images on my site. I think this means that they won't exist in the users Temporary Internet Files (which is nice), but how/where do I incorporate the java disable thing into my PHP graphic routine? which is along the lines of <IMG SRC = MakePicture.php!ThisPicture> (I forget the precise syntax) but it works a treat.
Does this java thing need to be downloaded for every picture or just once when the user logs in? That'd make it good..
<script language=JavaScript>
function clickIE() {
if (document.all) {
return false;
}
}
function clickNS(e) {
if (document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS;
}
else{
document.onmouseup=clickNS;
document.oncontextmenu=clickIE;
}
document.oncontextmenu=new Function("return false")
</script>