picture protection help pls

Discussion in 'Web Design & Coding' started by Biggie_mac, Jun 5, 2005.

  1. Biggie_mac

    Biggie_mac OSNN Junior Addict

    Messages:
    18
    I would like to know if there is a way to protect a picture that is on my site. I know..it's a stupid questions and I already know the answer...if someone can see the picture it means it can get it. Anyway let's get back on the topic. I can disable right click, I can use a transparent gif so anyone trying to click and save would actually save the gif...I can also use a script to disable "print screen"....but there is another simple way to copy it and I don't know hot to forbid(prevent) it. If anyone looks at the source code(and we know I can't posibly hide that) it can easily see the picture link and just copy it into the address bar. Basicaly he just writes www.mysite.com/images/image1.jpg and he has it. I would like to know how to prevent that...and I know it can be done. I mean there are sites where if u try to go to www.mysite.com/images/ it will display a "you are not authorized user" message...I mean all the porn sites are protected in the same way(you paste the link to a movie it will prompt for user and password). I know hot to do it in php(with sessions) but I don't know how to do it in html. If anyone has any ideea pls ...also if anyone knows how to forbid viewing the sorce code from View menu tell me. Everything I am doing and trying to do is easily bypassed by anyone with more than a little internet and html knowledge. But to the average user or a lot of people it works. Thank
     
  2. alan2273

    alan2273 I love the Penguin

    Messages:
    54
  3. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    you can use a .htaccess file to prevent hotlinking
    try this
    Code:
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?[i]yourdomain.com[/i](/)?.*$ [NC]
    RewriteRule .*\.(gif|jpe?g|png|bmp)$ [F,NC]
    
    just change the italics part to your domain name and it will then prevent other people from linking to the files from other websites. If you have that covered and then prevent right-click and print screen then you should be pretty much sorted

    http://www.alistapart.com/articles/hotlinking/ <-- alistapart article about image hotlinking prevention
     
  4. Hipster Doofus

    Hipster Doofus Good grief Charlie Brown

    Messages:
    5,920
    Location:
    Melbourne Australia
    And that would be Biggie Mac's 'Current Problem'. :p :D