/    Sign up×
Community /Pin to ProfileBookmark

Right Click Disable

Is there anything in PHP that you can turn off the right click? So you can save images and such. No i don’t really care that people hate that I just don’t want to be hotlinked and stolen from any suggestions??

to post a comment
PHP

19 Comments(s)

Copy linkTweet thisAlerts:
@knowjMar 05.2006 — its not 100% effective. you can easily turn off java. and if somone wants to get images etc... off your site they can do very easily
Copy linkTweet thisAlerts:
@SheldonMar 05.2006 — turn off java? or javascript? and you cat turn of either on their computer.
Copy linkTweet thisAlerts:
@knowjMar 05.2006 — javascript.


and i can disable both from the browser window in 2 clicks
Copy linkTweet thisAlerts:
@SheldonMar 05.2006 — Yes on your own browser, but Markbad311 wants to stop image hotlinking and steeling from his site by other people, turning off the java(waste of time in this case) and javascript in his own browser wont do anything.

You can stop image hotlinking with a simple script in your .htaccess script. Google "image hotlinking+.htaccess"
Copy linkTweet thisAlerts:
@NogDogMar 05.2006 — The simple answer: (1) You can disable right-click on some people's browsers via JavaScript, but it's easily bypassed by anyone who knows what they are doing even if their browser is one that supports such a thing. (2) You cannont stop someone from "stealing" any image that shows up in their browser. You can only make it more difficult for the casual user who doesn't understand anything about how his browser works. (3) The basic rule: if you don't want it copied, don't put it on the web (or else add some sort of watermark so at least other people know from where it was stolen).
Copy linkTweet thisAlerts:
@userloginMar 05.2006 — Copy an image is easy as 'Shift' + 'prt Scr' & 'ctrl' + 'v'.
Copy linkTweet thisAlerts:
@SpectreReturnsMar 05.2006 — Or going into the source. Just a tip, disable offsite hotlinking, or nobody is going to go to your site. I don't like not being able to right click and press "reload". Images can also be stolen with highlighting the image and copying it.
Copy linkTweet thisAlerts:
@userloginMar 05.2006 — OR.. it may just be simpler to just let people download the images by clicking on a button.

Very new to PHP so IM not sure if its possible at all but can PHP determine if the URL image request was result of a page load or not? if so, it should be fairly simple to work out if the request is valid or not, and you can offer up an alternate image in stead which says something like... 'Image stolen from: [http:www.domain.com]'
Copy linkTweet thisAlerts:
@SpectreReturnsMar 05.2006 — can PHP determine if the URL image request was result of a page load or not?[/QUOTE] No, but the server can. .htaccess will do it up.
Copy linkTweet thisAlerts:
@Markbad311authorMar 05.2006 — well I appreciate all the help I will move this Javascript portion of the question to the Javascript forum.

One thing is I have apache so I can stop the hotlinking. The Turning off right-click, yes I know it can be bypassed but what nogdog said is right THE CASUAL user will not know what to do. Thats what I am going on. is there anything I can add to a windows media player window (streaming or downloaded on the web page itself) to make is so they can not use the "..save target as" I have movies I would rather not have people that are CASUAL USERS rippin the movie off my site and/or hotlink(hotlink protection in Apache)..

So in recap..

How to stop save target as.. in windows media player: <object> or <embed> using php.

And I will move to the javascript forum with the disable right click for the image pages. (unless it is a quick script then probally don't need to do all that)

How do I watermark? (using PHP)
Copy linkTweet thisAlerts:
@Markbad311authorMar 05.2006 — nobody is going to go to your site. I don't like not being able to right click and press "reload".[/QUOTE]

I would be interested in the .htaccess..... and Um why in the heck would people NOT come to my site cause they can't right click that doesn't even make sense! I mean come on number one hit the F5 key it is less work two, who even reloads a page over and over again if their is nothing changing? REMEMBER CASUAL USER... You and I can steal images off of whoever whenever. The casual user however.... I don't think so.


Watermark HOW?
Copy linkTweet thisAlerts:
@SpectreReturnsMar 06.2006 — I hate coming to websites that disable my right click, and most people do too. When you're performing something valid and it tells me I can't, I get pissed off and hit ALT + F4, and then don't go back there ever again. That's how people won't go to your site.

As for the .htaccess, perhaps try [url=http://www.google.ca/search?q=image+hotlinking+.htaccess]searching[/url]
Copy linkTweet thisAlerts:
@Markbad311authorMar 06.2006 — well I realized after I asked about the .htaccess that I don't have to manually I am ultimately doing the same thing inside of cPanel.... I just don't see a reason for anyone to get mad.. See I decide what is valid on my site and if shortcut menu has something on it that is not valid to me or I don't want. it is up to me to change it. No one should be using refresh on my site for their is not up to the second information or post on there. The only people that are right clicking are the people that are taking my video or images. not refreshing. only other thing is book mark this page in which I can simply add a javascript function to do that at a click of one mouse button not two..

refresh shortcut menu two clicks

refresh shortcut keys one button F5, CTRL+R

book mark shortcut menu two clicks

bookmark through JS one click.

CTRL+D


See it is faster, easier, and all that jazz to not use the shortcut menu anyways. Just my opinion everyones is valid. I just don't see anyone in their right mind never coming back to a useful page simply because on CERTAIN pages they can not right click.

I can't even believe I heard you say that you never would return again thats just proposterous. You don't even stop and think, man I wonder if there is a valid reason for this?

Remember I am not talking about SiteWide anyways just certain pages like video pages and such. I am gonna get stolen from thats just the breaks but making it a little harder for them just feels right.
Copy linkTweet thisAlerts:
@bokehMar 06.2006 — I can't even believe I heard you say that you never would return again thats just proposterous.[/QUOTE]No it's not. The browser belongs to the client not the server. If a site tries to alter the behaviour of my browser I leave the site not to return (if necessary closing the browser).

If you are worried about image theft (are you Picasso) then either use .htaccess to limit hotlinking, watermark your images, limit your most precisious images to logged in user or just don't put them on the web.

The following in .htaccess will limit hotlinking:[CODE]<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER}---%{HTTP_HOST} !^http://([^/]+)/.*---1$ [NC]
RewriteRule .(gif|jpg|png)$ - [F,L]
</IfModule>[/CODE]


Lastly remember, [I]the customer always comes first[/I]. Don't do anything to annoy them
Copy linkTweet thisAlerts:
@Markbad311authorMar 06.2006 — Well I can see someone being upset that they can't use normal functions of the browser but [U][B]they are all still there[/B][/U], and yes when it comes to my media content I might as well be picaso because if someone is repurposing them then there is going to be a problem.

Hotlink isn't a problem already did that.. I will have to work on the Watermarking. As well as disabling the right click function on my Video pages (band reviews). Soley because this media also belongs to the bands in the area. They are my paying customers, and their content and their concerns will and always have came first.

Thanks for all your input on the subject everyone I now appreciate the risks of losing content and limiting user access to the content.
Copy linkTweet thisAlerts:
@userloginMar 06.2006 — ......I can't even believe I heard you say that you never would return again thats just proposterous. You don't even stop and think, man I wonder if there is a valid reason for this? ...[/QUOTE]

I also leave those sites well alone, if a site disables right click, its annoying to say the least, pretty childish and says to me that the site owner has something to hide...
Copy linkTweet thisAlerts:
@AJAXMar 06.2006 — The browser belongs to the client not the server.[/QUOTE]I agree. When I go to a site like that I feel the website owner is trying to tell me they are more clever and more important than I am even to the extent that they think they are allowed to control my software in a fashion that is against my wishes.
Copy linkTweet thisAlerts:
@felgallMar 06.2006 — For those of you who don't like having your right click disabled by misguided web sites - why not switch to using Opera which completely ignores such stupid scripts and leaves the context menu fully functional regardless of what the Javascript in the page says.

Any attempt to block right click or encrypt the page source is a flag to would be thieves that "here is something the owner thinks is worth stealing" and so they WILL STEAL IT since there is no way to stop them. The only people affected by such scripts are your normal visitors who will leave the site quickly when they find out you are trying to interfere with the operation of their browser.

The best way to minimize theft of your content is to NOT apply any "protection" using Javascript.
×

Success!

Help @Markbad311 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...