Hello, I am developing a site for a client which is related to photography. My client doesn't want the images on the site to be accessed by anyone except its own site i.e a person can view the image when opens website but can't see image when type entire url of the image in browser. Any solution? any asp or php script? I have protected site from hotlinking. Thank you
You might look into .htaccess, although I am not exactly certain where to direct you. As for .php I do know you could put a sort of wrapper around your images. What you would do is make the source of any image something like src="http://www.example.com/images.php?image=7". Then you have a .php file that checks to make sure the requesting page is a valid page, finds that image requested and returns it. If they try to directly browse to that image you send them a picture that says 'Invalid Request' on it. For this, look at the header function in php.
You can make it hard for someone to access the images, but you cannot totally stop them. By definition, to view the images, they MUST BE DOWNLOADED TO THE VIEWER'S COMPUTER. Once the images are on his computer, YOU TOTALLY LOSE CONTROL OVER THEM. The ONLY GUARANTEED solution is to NEVER put the pictures on the website.
Disabling right-click will just make it slightly harder to download the images... The best thing would probably be to watermark the images, and only use thumbnails. Because no matter what you do, if the image is being displayed a simple Print-Screen (take a screenshot) can be used to get the image regardless.
Disabling right will make a difference ot the newbies but people who want to get things find creative ways to getting them. I would suggest: 1) Water mark the photographs/images 2) Place a blank transparent image over all images so when someone right clicks and saves they will save a blank file. 3) Another idea you can use is to use javascript or even CSS, so when some one hovers over the image it changes to another image(such as a fixed company name image- which the user will NOT want to save) But it is extremely difficult to hide your images online, even if you undertake the above mentioned ideas(from myself and others)
You can disable hotlinking in .htaccess file, but it won't prevent saving the image on any computer, then hosting it elsewhere. You can try to create a PHP file, example getfile.php and use readfile(); function so the real image link won't be displayed, but this won't prevent taking a screenshot and croping it!