Discussion Locked

Need help

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello there...

I've seen it done on some web sites, and I wanted to do it on my own. How do I disable a View Source and a Save or Save As function on a web page?

Any help will be appreciated... thank you in advance.

4 replies

by anton gombkötö

Sorry, you are looking for something impossible to do. A browser always loads the HTML and displays the page. That's what you want. What you do not want is to allow somebody to look at the code. But i need not use a browser to access the page. I candownload it with utilities like e.g. GetRight (http://www.getright.com) and can save the file. With CGI, you could check whether there is a browser's id given as "user agent", but i can fake this, too.
So you can't prevent users from looking at thecode. But you can prevent them from understanding the source.
The key to this is some kind of encryption. You encrypt the whole page via an algorithm and decrypt it with JavaScript and create the page in the browser. You can find various codes forthis on the internet. But once again - as you have to provide de decryption algorithm, a smart enough guy could still decrypt the code and look at your HTML source, so it's not worth the effort.
You don't tell us what you want to do, so i can't start guessing *why* you don't want to the code to be visible.

[when my english sounds funny, excuse me, i'm austrian]

by generalist

If all you're trying to do is hide the HTML, then there are some doubts as to the usefulness of the tack.

On the other hand, hiding the JavaScript might be useful because that can be worth something.

Still, hiding it from "View Source" may nothide it from the cache. And if it is in the cache, you can view it. (IF you know about that little fact.)

This discussion is closed to new replies.