Web Analytics Made Easy -
StatCounter question about right click functions - CodingForum

Announcement

Collapse
No announcement yet.

question about right click functions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • question about right click functions

    hi, i just wanted to know how can i disable the functions when a user press right click with a mouse? i ask because i will like to avoid people saving my pictures in their computers. can i do that in php or is in java? i will apreciate some code , thanks

  • #2
    This cannot be done using PHP or Java. You would need to use Javascript. I will move this to the Javascript forum.

    Be warned though that other members will point out to you that this is pretty pointless and I am sure they will elaborate on that so I will not.

    Moving thread...
    Spookster
    CodingForum Supreme Overlord
    All Hail Spookster

    Comment


    • #4


      .....Willy

      Comment


      • #5
        RightClictoKleptophobia -- just another irrational fear.
        hmm... ?

        Comment


        • #6
          As has been pointed out a zillion times, you cannot protect your code or images from the kind of people who frequent this forum. But the protection may well be effective against the 99% of web surfers who would not recognise a Javascript function if it jumped out of the screen and bit them.

          Just as with your physical goods, if someone is a professional thief and is really, really determined to steal them then they will, pretty well regardless of your defences. But simple/ordinary precautions such as no-right-click scripts and a bit of obfuscation will drive away the casual or opportunistic thief.

          A paradox is that those who have the expertise and are most able to steal your code and images are those least likely to want to do so - they can write their own, and better!

          A no-right-click script also gives very clear notice that the owner of the image does not want it to be copied, and hence whoever takes it knows perfectly well that he is a thief. He cannot say "Oh, I expect the guy will not mind ......", or "If it's on the web it's free for anyone to take, innit?"
          Last edited by Philip M; Feb 17, 2004, 03:21 AM.

          All the code given in this post has been tested and is intended to address the question asked.
          Unless stated otherwise it is not just a demonstration.

          Comment


          • #7
            A paradox is that those who have the expertise and are most able to steal your code and images are those least likely to want to do so - they can write their own, and better!
            Yes but some will actually steal the code and email the author and show him his very precious code.
            Glenn
            vBulletin Mods That Rock!

            Comment


            • #8
              Glenn - it is not precious. It is probably very poor by your standards. That still does not give people the right to steal it.
              In fact stealing from the poor may be worse than stealing from the (knowledgeably) rich such as you!

              All the code given in this post has been tested and is intended to address the question asked.
              Unless stated otherwise it is not just a demonstration.

              Comment


              • #9
                I have seen scripts longer that disable this but this is what I use

                document.oncontextmenu=function(){return false};


                and as mentioned it can be disabled, the pictures is already downloaded etc,etc..

                Comment


                • #10
                  I said "precious" from the point of view of those authors that "protect" their html source codes. Of course, I didn't mean "precious" in the real sense of the word, I just used that word to ridicule them.
                  Glenn
                  vBulletin Mods That Rock!

                  Comment


                  • #11
                    I think this right click disablement can be got around if a user switches of JavaScript in his browser.

                    I stand corrected though.

                    Comment


                    • #12
                      More to the point - how dare anyone disabled my context menu? What if I want to open a link in a new window, or send some highlighted text to Google?

                      When I come across a site that uses no-right click (thankfully rare) I make a conscious note never to visit that site again. Presumptuous MF ... deigning to mess around with my user interface.

                      It's just not on - even if it did stop people looking at source code, the costs involved outweigh the interests being protected. So leave it alone.
                      "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

                      Comment


                      • #13
                        ehh ok i got the point, i asked because here in puerto rico , things are getting worse everyday, lots of crimes drugs etc. and in the cyber world many m.......f........ just copy pics from a descent person and publish them just to f..... and i hate that, there many lammers in my island and i just dont wanted to see my pics in others pages with something written that is not true or whatever......but thanks anyway

                        Comment


                        • #14
                          Originally posted by brothercake
                          When I come across a site that uses no-right click (thankfully rare) I make a conscious note never to visit that site again. .
                          Well, that is pretty disappointing news, but I suppose that I will just have to learn to live with it. I expect my sales will slump dramatically now. In any case I doubt if members of this forum would be interested in viewing the utterly revolting and disgusting sick perverted filth which is included in my site (I bet that got your attention!). The f-word (font) is to be found frequently on every page, completely shamelessly, so it is only reasonable to shield people's sensibilities by using a (silent) no-right-click script as a sort of "decency board" to prevent them from seeing this sort of corrupting stuff.

                          All the code given in this post has been tested and is intended to address the question asked.
                          Unless stated otherwise it is not just a demonstration.

                          Comment

                          Working...
                          X