Hosting | Domain Registration | FAQ | Additional Services | Contact Us | Forums | About Us | Home 

Disable right click & stop bandwidth theft

Before you jump right down to the script, learn something more!!!
We explain about other options to stop people from copying or stealing your images.

If you use all the info on the page you leave the determined thief no alternative than to take a screenshot of your image and then edit it in a graphic program.

To disable right click (works only on pc with MS operating systems), is practical if you have nice images or your own artistic work and you don't want people to (steal,) copy or save them to their harddisk and maybe use your images on their website or other publication and media.
There is however a downside to this, as the user will not either be able to right click on your links to open them in new windows (when they dont want to leave your site or the page they are on already). Many will find this annoying.

If you are afraid that they are to use your bandwidth read on. Those that steal bandwidth use "hotlinking" or posting your image on their website, and link it to load from your serverspace. When somebody looks at their page they steal or use your bandwidth that you pay for.

The solution to stolen bandwidth or "hotlinking" is to host your site at ITfam.NET because in your control panel you can block theft from happening.

In the control panel (from ITfam.NET) you can also make it so that if they encode the location of your image to be displayed on their website, then your web-hosting-solution from ITfam.NET re-directs the browser to a page you decide!!! This is a FREE feature for ITfam.NET hosting customers!!!
Example: Somebody wants to use the php sign below on their page. On their page they link it to: http://www.yourdomain.com/images/php.gif but when the visitor opens that page and it is about to load your image on the forreign page it discovers that it must go to: (homepage) http://www.yourdomain.com/index.html or (copyright page) http://www.yourdomain.com/copyright.html.

You cannot hinder people from looking at your source code, BUT you can block people from typing the URL that displays the single image they want to see and then copy the image! (You cannot use the disable-right-click script in a window with only an image in it!)
Example: Again somebody wants to copy the php sign below. With the script below you can disable the right click, but they are smart and look at your source code. The bandwidth theaf finds out that the image is located at: http://www.yourdomain.com/images/php.gif and types this in their browser, but the image will not be displayed. However, this also hinders you from displaying images on your site with out the image being encoded onto a webpage!

If you got questions about this, post them at the ITfam.NET support forum.

OK, ok, enough alternative considerations and here is the script.

It must be in the header of the page. In my test I placed it just before the header end-tag: </head> and it worked fine.
If you want to give a message to the person that right clicks, you can type it into the script on the third line between the
""-characters. There is no additional support for the script.

<script><!--

//Disable right click script 1 - By ITfam.NET (http://www.itfam.net)

var message="";

///////////////////////////////////

function clickIE() {if (document.all) {(message);return false;}}

function clickNS(e) {if

(document.layers||(document.getElementById&&!document.all)) {

if (e.which==2||e.which==3) {(message);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")

// -->

function reEnable(){

return true

}

//if IE4+

document.onselectstart=new Function ("return false")

//if NS6

if (window.sidebar){

document.onmousedown=disableselect

document.onclick=reEnable

}

</script>