Hello I'm developing a image uploading website where users can upload there photos... I want to add a feature where user can disable right click on his/her photos so that other cannot download there photos... Can any one provide me the code of disabling right click and explain it...
This would have to be javascript based. Do a search for javascript disable right click. Personally, I would recommend against doing this. It can be easily bypassed, and is a usability killer.
Yup don't waste your time, if anything when i see a website which disables it people make a point of just trying to bypass it.
As others said disabling "right-click" is not the solution to prevent web users from copying the photos. Users can disable javascript and download the photos. if you dont want others to download/copy photos, the only option is not to show the photo at all (or watermark the photos).
The best way would be to overlay your image with a transparent PNG or GIF. If the user was to right click and save the image, they'd only be able to save the transparent gif/png.