I am creating a web site and my client demands to restrict user to copy TEXT displayed on the web page
.how can I do that? I am using PHP and HTML in my application.
Not trying to be rude, but why do people keep asking this? If you want people to be able to see the information, then you cannot prevent them from copying it. Any kind of javascript nonsense to prevent right-clicking or selection or whatever else will not stop determined thieves and will annoy legitimate users.
As mentioned by every answer previously, there's no way to prevent someone from being able to use the copy from your site. Even if you use methods to restrict direct copy and paste, there are always screenshots, OCR or good old writing by hand.
Looking at it from a different perspective...if the content is sensitive and your client doesn't want it distributed, you COULD add it to a section of your site that requires registration and authentication to access. By doing this you could require that users agree to terms and conditions on registration which explicitly deny permission to reproduce any of the content from the site.
Just a thought.
As every other answer has said, there is nothing technically you can to to prevent people from copying the text of your page. For the text to be display to the user, you must send it to the user's computer, which means they can copy it.
However, you can legally prevent them from copying the text with a service like CopyScape
Copyscape is dedicated to protecting your valuable content online. We provide the world's most powerful and most popular online plagiarism detection solutions, ranked #1 by independent tests. Copyscape's products are trusted by millions of website owners worldwide to check the originality of their new content, prevent duplicate content, and search for copies of existing content online.
Copyscape provides a free service for finding copies of your web pages online, as well as two more powerful professional solutions for preventing content theft and content fraud:
Copyscape Premium provides more powerful plagiarism detection than the free service, plus a host of other features, including copy-paste originality checks, batch search, case tracking and an API
Copysentry provides comprehensive protection for your website by automatically scanning the web daily or weekly and emailing you when new copies of your content are found.
Read more on their site.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With