Need Code For Disabling Right Click

Discussion in 'PHP' started by cynical_tear, Jul 14, 2009.

  1. #1
    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...

     
    cynical_tear, Jul 14, 2009 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    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.
     
    jestep, Jul 14, 2009 IP
  3. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #3
    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.
     
    wd_2k6, Jul 14, 2009 IP
  4. krishmk

    krishmk Well-Known Member

    Messages:
    1,376
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    185
    #4
    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).
     
    krishmk, Jul 15, 2009 IP
  5. JefK

    JefK Member

    Messages:
    66
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    45
    #5
    I agree that it is a bad idea to disable right-click, it's just annoying and won't save your html.
     
    JefK, Jul 18, 2009 IP
  6. papa_face

    papa_face Notable Member

    Messages:
    2,237
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    285
    #6
    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.
     
    papa_face, Jul 18, 2009 IP
  7. sajidzaman

    sajidzaman Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Loading your images in flash can also be one option.
     
    sajidzaman, Jul 18, 2009 IP
  8. DemCage

    DemCage Peon

    Messages:
    77
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    At the moment, there is nothing you can do against a screenshot.
     
    DemCage, Jul 18, 2009 IP