Protecting pages on website...2 Questions...

Soldato
Joined
14 Oct 2007
Posts
2,738
I have 2 questions regarding my website. Currently putting it together, so not ready at the minute, but will be used to display my photography.

Here's my questions:

1) How can I stop people from Right-Clicking an image and Saving them?

2) I want to have a page which will require you to log in to view as a friend has asked if she can host her photos as a portfolio to get work so I need to make it possible where you have to log in to the page to view it...any ideas?

Thanks
 
1) You would need to utilise something other than HTML for this as while you can make it harder to interact with an image directly, a semi-knowledgable user would always be able to save a copy of the image. You could try packing the images in IP-protective software like Flash for instance, which you could then build into your web page.

2) You could try using pre-built libraries or frameworks with log-in features, or if you were planning to do this yourself, use a short PHP script with either simple server side files or a database for storage of usernames and passwords and JavaScript and cookie- or session-setting for the client. It would depend on what you wanted it to do and your level of experience.
 
Last edited:
1) How can I stop people from Right-Clicking an image and Saving them?

Disable Right Click Script :-

http://www.dynamicdrive.com/dynamicindex9/noright.htm

However, as guyfawkes5 already said, it's not quite as simple as that although the above script will work for most "ordinary" web browsing folk with no tech savvy.

As well as that, folk can still use the old "Prt Scr" key and take a screen capture then crop out any images they want and even images embedded into Flash aren't immune if you use something like Webshots :-

http://www.websitescreenshots.com/
 
Indeed, it is often nearly impossible to completely protect online content and most times what you are aiming for is a level of security that merely heads off the 'common' approaches.

To somewhat counteract screenshots, you could try having Flash dynamically watermark each image if you were to go down that route, but again this doesn't render the content invulnerable. I suppose it just depends on the levels you think people will go to to steal your work. :p
 
#1 is impossible. You can make it more tedious to grab the images, but as long as someone can view it, they've downloaded it already. Even if you could disable it, whats stopping a print screen, then a crop anyway? Not worth the effort imo.

#2 .htpasswd is the easiest method. If you need fine grained user access control, you're going to need to install, or write some code to handle that.
 
For the second you *could* use a htaccess password for the page although this is the "takes 2 minutes and works solution".

In the htaccess file;
AuthType Basic
AuthName "Restricted Access"
AuthUserFile /home/public_html/dir/.htpasswd
Require user mark

You'll then need to make a .htpasswd file with the user and password in it
 
Last edited:
Trying to stop people being able to save your images is a complete waste of time. And by trying to implement any methods your only going to hinder your normal visitors experience whilst not stopping anyone from actually being able to copy your images.

I would suggest lowering the resolution of the web version and/or quality of the image instead.
 
Petty argument for what is clearly petty reasons, m4rkw7.

Disabling right click on websites is a fools game. You will lose visitors. You are damaging the user experience of your website. There is only going to be one loser in this game, and that is the owner of that website.
 
Yes, I really hate sites that disable right click and have to be honest, if a site has that.. I will try to find a better one.

Trying to open other tabs from a site like that is... impossible.
 
Back
Top Bottom