Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Apr 2007
    Thanked 0 Times in 0 Posts

    right click disactivation

    Hello to all:

    Not sure if this is where this post belongs, but my question is this..

    How can I disactivate the right-click function on a mouse for a certain webpage? Is this javascript or html? For example, if I don't want someone to be able to right click and copy a photo.

    Thanks so much,

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    London, England
    Thanked 2,566 Times in 2,544 Posts
    This question has been asked and answered a zillion times. Do please use the search facility or look in the FAQs (No.13).

    The short answer is that you cannot prevent someone from copying an image or the code from your site. At best you can make it a bit harder, and possibly deter people who have no knowledge of coding.

    Why do you think your images are worth stealing anyway? You can always add a watermark which will indicate your copyright.

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Thanked 14 Times in 14 Posts
    It also prevents the user from using options in the context menu not associated with the website
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.

  • #4
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Denver, Colorado USA
    Thanked 335 Times in 327 Posts
    On web sites where right-click was disabled and I wanted to create a short-cut to it so that I could easily go back to the same web site later, not only did the disabled right-click prevent me from quickly creating a short-cut, but it also caused me to quickly click the big red X icon at the upper right corner of the browser. Inconvenient web pages don't keep visitors on them for very long.

    You cannot keep anyone from seeing, saving, or printing content on your web site. If you don't want anyone to see, save, or print your content, don't put it on a web page.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts