Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I want to protect my web pages elements 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Can you help me to protect my web pages from: copy image, save web page as, etc?
One more question pls: How to implement a download on my web pages?
Thank you!
 
You can't really. Once the page is downloaded it will be stored in your computers cache, and stored. If pictures are valuable watermark them with software or put a translucent logo on the picture so it is clearly yours
 
For downloading, if you make your link to a file that cannot be displayed in the browser, e.g. .exe or .mp3 etc than it should automatically bring up a download box.

Stuart
 
Try this javascript between the <head></head> on your html page.

<SCRIPT TYPE=&quot;text/javascript&quot;>
<!-- By Mike McGrath mike_mcgrath@lineone.net -->
<!-- -->
/* Insert code between <head></head>*/
/* thewebmasterdirectory.com free java scripts*/
<!--
var msg = &quot;Right-Click Disabled&quot;;
if(document.layers) window.captureEvents(Event.MOUSEDOWN);
function no_click(e){
if (navigator.appName == 'Netscape' && ( e.which == 2 || e.which == 3))
{
alert(msg);return false;
}
if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3))
{
alert(msg);return false;
}
}
window.onmousedown=no_click;
document.onmousedown=no_click;
//-->
</SCRIPT>

For any one that is going to dig through the cache it won't do much good. But for most users, it will stop them.

Here is another script that says &quot;Not enough system memory to display source/perform graphics save, repeat right-click to delete systems files and free resources for display. Click OK to abort file deletion.&quot;

This goes in the <head></head> section too.

<script language=&quot;JavaScript&quot;>
function noRightClick(evnt) {
errMsg=&quot;Not enough system memory to display source/perform graphics save, repeat right-click to delete systems files and free resources for display. Click OK to abort file deletion.&quot;
if (navigator.appName.toUpperCase().match(/NETSCAPE/) != null) {
if (evnt.which == 3){alert(errMsg);return false;}}else
if (event.button==2)alert(errMsg);}
document.onmousedown=noRightClick;
</script>

But if you *hold down the left mouse button before a right mouse click, you can bring up the menu.

I collect stuff like this and make simple html files in notepad and then test them with a browser. Some of the things I find are really funny... some are pretty useful. I am starting to get a collection of small html pages on my local drive that I can test in Netscape or IE and when I need something for a client, I've got a working example.

Hope this helps, it may keep some from saving graphics

Jim
 
Yes this prevent right click thing works but it is very visitor unfriendly. I would not advise it. I used it once and the negative feedback was very quick in coming.

For collecting snippets of code and having them easily accessible I use Treepad Lite which resides in the systray. Excellent little program
Regards
 
Well, it only 'works' if the user has JavaScript enabled on their browser... Even then, it does nothing to stop the user availing themselves of the menu options for viewing source code, or in the case of graphics simply dragging them into a folder.

Just to refresh everyone on how a web site works:
[ul]
[li]Web server has files sitting on it.[/li]
[li]Browser issues a GET request for a particular resource.[/li]
[li]Web server transmits a copy of any files requested back to the browser.[/li]

Whenever a user requests your web page, you send them a copy of all the source code and all the images that make up that page. The source code and images have to arrive at the browser in a format that the browser can read. Browsers read HTML and Script. If you send the browser something it can read, then any human that has a knowledge of these things will be able to read it. Whenever you have a machine that is connected to the internet, the information on that machine is accessible. The degree to which it is accessible may vary, but there is no such thing as watertight security.

If you have HTML code, Script or Images that are so valuable as to not want anyone getting a copy of them, why would you put them on a web server to begin with?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top