First of all thanks in advance..
I want to disable view page source
, copy
and paste image
etc .. in my web site.
How can I do it? I know php and javascript.
First of all thanks in advance..
I want to disable view page source
, copy
and paste image
etc .. in my web site.
How can I do it? I know php and javascript.
There is no perfect way to do this.
You can cancel right mouse events with Javascript, but what if I disable Javascript?
Plus I can always do CTRL+U in Firefox to view the source.
And since the browser has to parse the HTML / Javascript in the end you can always see it in a debugger like Firefox.
Let go of the idea. It's impossible.
Don't bother. There is no foolproof way of doing this. Ultimately, if you're publishing the content (and source code), then you have to accept that other people will be able to copy it.
Any solution to this is going to rely on the user's browser cooperating, but the browser is under the control of the user, so you can't make this assumption. Usually it's simply a case of disabling JavaScript, which is trivial. It'll also be irritating and patronizing for many of your users.
In short. You can't.
Disabling things like right clicking in Javascript are just annoying for end users. And it doesn't prevent them from saving the file or viewing the source from the browser menu or shortcut or various other means.
Don't bother.
This article will show you how to disable the right click, but let's remember these points:
To be honest, trying to prevent a user from stealing content in this obtrusive manner is probably going to spur them on the find another method...
So in short, think twice before implementing this.
Developers and clients who request these type of features just doesn't "get" what the internet and the www are all about.
As far as I know you can't disable view source. You can use use tools like dotfuscator to make your code unreadable, but you can't disable view source.
You can disable copy-paste, but you shouldn't do that either. Here's a good discussion on that topic: Disable pasting text into HTML form
Why do you want to do that? I hate sites that attempt to do that. It's possible to capture and suppress right click from javascript, but it's a poor solution that will only prevent users with very basic skills from viewing the source.
But I guess you could use flash or silverlight...
An out of the box idea : Generate output in PDF
Pros:
Cons: