#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2006
    Posts
    262
    Rep Power
    0

    Disable user to copy website content and image


    Any idea how to block the public to copy my website content and image?

    Thank so much.
  2. #2
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,249
    Rep Power
    9400
    It's not possible. Any sufficiently motivated user can grab all your HTML and Javascript and CSS and images and there's nothing you can do to stop that.

    What they can't grab is your PHP code.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2006
    Posts
    262
    Rep Power
    0
    I have came across some website, when i want to click right click to copy the content, the website will prompt me "Copyright by company XXX".. and block me from copying the content. can't we do that in php?

    same as image, when i right click to "Save as" one particular image, the system will also prompt me "Image under copyright of company XXX". thus i cant save.

    really no idea in php ?

    thanks.
  6. #4
  7. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    No, you can't do it in PHP, all of what you're talking about is JavaScript.

    And while that may have stopped YOU, it doesn't pose more than 15 seconds of a delay for me or Requinix.

    These tactics only provide the bare minimum of protection for your site. If you send me a file, I will have it, that's the whole point. Anything you let the user see, they can keep. javascript which breaks the right mouse button just blocks legitimate users who want to email your pictures to their mom. It poses no obstacle whatsoever to the people actually attempting to rip you off.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  8. #5
  9. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,249
    Rep Power
    9400
    To elaborate,

    For your website to work you have to send some files to the user. Their browser. You must freely give over these files or else your website will not work. Since you've done that, I can look at those files and do whatever I want with them. I can make copies, look at the source, and perhaps even make changes to them (my versions, not the originals) while they're still in the browser.

    That's why it's impossible to protect your content: because I already have a copy of it.
  10. #6
  11. Mad Scientist
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2007
    Location
    North Yorkshire, UK
    Posts
    3,661
    Rep Power
    4124
    and website mirroring software like WinHTTrack can take an entire backup of all public files found/linked to by your site
    I said I didn't like ORM!!! <?php $this->model->update($this->request->resources[0])->set($this->request->getData())->getData('count'); ?>

    PDO vs mysql_* functions: Find a Migration Guide Here

    [ Xeneco - T'interweb Development ] - [ Are you a Help Vampire? ] - [ Read The manual! ] - [ W3 methods - GET, POST, etc ] - [ Web Design Hell ]
  12. #7
  13. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Hi,

    I think you should completely forget this idea of "hiding" your content.

    First of all, do you really think your site is so revolutionary that people will actually try to rip it off? No offense, but all pages I've seen with these stupid JavaScript alerts and tons of "copyright" signs were amateur home pages that nobody would bother copying, anyway. Professional sites simply don't use this.

    Secondly, this is extremely annyoing for all users. Unless you offer special information that can't be found anywhere else, people will simply leave your site. Wouldn't you do the same?

    And last but not least: "Features" like this make you look like an amateur. They're completely useless (as already explained), and they're somewhat out of fashion. This stuff was popular in the 90s (together with Java applets, blinking fonts and colorful backgrounds). Modern sites are a bit more ... subtle.
    Last edited by Jacques1; October 30th, 2012 at 06:09 AM.
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    9
    Rep Power
    0
    Instead of trying to hide your images etc why dont you just brand them with a watermark, nothing too ridiculous obviously but enough for someone to know where the picture came from.

    That way of someone does copy and use your image you are getting free advertising from it anyway. Or they have to spend ages editing the photo to remove your watermark
  16. #9
  17. Mad Scientist
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2007
    Location
    North Yorkshire, UK
    Posts
    3,661
    Rep Power
    4124
    There's plenty of open source PHP libs that can add watermarks to your images - just give google a call
    I said I didn't like ORM!!! <?php $this->model->update($this->request->resources[0])->set($this->request->getData())->getData('count'); ?>

    PDO vs mysql_* functions: Find a Migration Guide Here

    [ Xeneco - T'interweb Development ] - [ Are you a Help Vampire? ] - [ Read The manual! ] - [ W3 methods - GET, POST, etc ] - [ Web Design Hell ]
  18. #10
  19. No Profile Picture
    I haz teh codez!
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2003
    Posts
    2,552
    Rep Power
    2337
    I am well and truly appalled at the number of "web developers" that don't even understand how the web works.

    Comments on this post

    • Jacques1 agrees
    I ♥ ManiacDan & requinix

    This is a sig, and not necessarily a comment on the OP:
    Please don't be a help vampire!
  20. #11
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    15
    Rep Power
    0
    There are three simple ways to protect your website contents.

    1. Disable copy and paste by selecting the contents
    2. Disable of Right Click Mouse Button
    3. Using CSS Elements in body tag -moz-user-select: none;

    1. Apply this code in your html document inside the <body> tag

    “ ondragstart=’return false’ onselectstart=’return false’ ” – to disable copy and paste
    For Example:
    <body ondragstart=”return false” onselectstart=”return false”>

    By applying this code, we can easily disable the drag and drop option in order to avoid copying the contents

    2. Use this script in your html document before closing the </head> tag

    <script language=JavaScript> var message=”Function Disabled!”; function clickIE4(){ if (event.button==2){ alert(message); return false; } } function clickNS4(e){ if (document.layers||document.getElementById&&!document.all){ if (e.which==2||e.which==3){ alert(message); return false; } } } if (document.layers){ document.captureEvents(Event.MOUSEDOWN); document.onmousedown=clickNS4; } else if (document.all&&!document.getElementById){ document.onmousedown=clickIE4; } document.oncontextmenu=new Function(“alert(message); return false”) </script>

    By using this script, we can disable the Right Click Mouse Button in order to avoid draging/copying the images and contents

    This script is specially useful to avoid copying the images

    3. give security to the contents by using the css elements in body tag

    EX: in css file

    body {

    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -o-user-select: none;

    }

    Comments on this post

    • requinix disagrees : will NOT protect your website
    • BarryG disagrees : This will NOT protect your website from anyone who knows what they are doing. If it stops you, then .....
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Location
    Sydney Australia
    Posts
    189
    Rep Power
    84
    Originally Posted by henryc07
    There are three simple ways to protect your website contents.
    Rubbish. If I can see your website, then I ALREADY have a copy of it.
  24. #13
  25. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    The worst thing is that this stuff still gets copied and pasted around (kind of ironic for an anti c&p script). He has probably copied it himself from some dubious JavaScript "tutorial".

    Dude, even if your users understand the Internet as little as you, what prevents them from simply making a screenshot of your precious images? That's what I did as a kid.

    If you want to make sure nobody ever uses your content, simply don't publish it. Put it in a safe and don't let it anywhere near an Internet connection. But if you do publish it (and it's of any use), you'll have to live with the fact that somebody might actually "steal" it, no matter how much JavaScript magic, water marks and warning signs you put on your website.

    But is this "stealing" really that terrible? Do you actually lose anything? And isn't sharing kind of what the Internet is about?

    Simply put your content under your favorite licence and cut out all the outer stuff that just makes you look stupid.
    Last edited by Jacques1; November 1st, 2012 at 02:22 AM.

IMN logo majestic logo threadwatch logo seochat tools logo