Click to See Complete Forum and Search --> : Hiding HTML Source
jkim2400
03-01-2003, 01:21 PM
Hi,
I'm a newcomer here.
I was just wondering if anybody could give me a code that would enable me to hide my source...in other words, if someone clicks on "view source" it comes out blank. I'd greatly appreciate it if anyone could help me with this. Thanks.
jkim2400
03-01-2003, 04:28 PM
Really??
=( Well, here's my problem. I have only a limited amount of bandwidth, and I don't want people to steal it by linking directly to the images on my site. So I need someway to prevent that from happening. Do you have any advice on how to solve this problem?
2 peachy
03-01-2003, 05:05 PM
js file
<!-- ||||| SOURCE CODE ENCRYPTION - START ||||| -->
document.write('<title>||||| SOURCE CODE ENCRYPTION |||||</title>');
document.write('<frameset rows="100%,*" framespacing="0" border="0">');
document.write('<frame frameborder="0" name="topFrame" src="encrypt.htm" noresize="noresize" />');
document.write('</frameset>');
<!-- ||||| SOURCE CODE ENCRYPTION - END ||||| -->
encription page
<HTML>
<HEAD>
<TITLE>This is your home page.</TITLE>
</HEAD>
<BODY>
<!-- ||||| SOURCE CODE ENCRYPTION - START ||||| -->
<script language=JavaScript>m='%3Cscript%20language%3DJavaScript%3E%3C%21--%0D%0A%0D%0Avar%20message%3D%22Function%20Disabled%21%22%3B%0D%0A%0D%0Afunction%20clickIE%28%29%20%2 0%7Bif%20%28document.all%29%20%7Balert%28message%29%3Breturn%20false%3B%7D%7D%0D%0Afunction%20clickN S%28e%29%20%7Bif%20%0D%0A%28document.layers%7C%7C%28document.getElementById%26%26%21document.all%29% 29%20%7B%0D%0Aif%20%28e.which%3D%3D2%7C%7Ce.which%3D%3D3%29%20%7Balert%28message%29%3Breturn%20false %3B%7D%7D%7D%0D%0Aif%20%28document.layers%29%20%0D%0A%7Bdocument.captureEvents%28Event.MOUSEDOWN%29% 3Bdocument.onmousedown%3DclickNS%3B%7D%0D%0Aelse%7Bdocument.onmouseup%3DclickNS%3Bdocument.oncontext menu%3DclickIE%3B%7D%0D%0A%0D%0Adocument.oncontextmenu%3Dnew%20Function%28%22return%20false%22%29%0D %0A%0D%0A//%20--%3E%3C/script%3E';d=unescape(m);document.write(d);</script>
<!-- ||||| SOURCE CODE ENCRYPTION - END ||||| -->
This is the text on your home page.
<p>
</BODY>
</HTML>
html page
<HTML>
<HEAD>
<TITLE>This is your home page.</TITLE>
</HEAD>
<BODY>
<!-- ||||| SOURCE CODE ENCRYPTION - START ||||| -->
<script language=JavaScript>m='%3Cscript%20language%3DJavaScript%3E%3C%21--%0D%0A%0D%0Avar%20message%3D%22Function%20Disabled%21%22%3B%0D%0A%0D%0Afunction%20clickIE%28%29%20%2 0%7Bif%20%28document.all%29%20%7Balert%28message%29%3Breturn%20false%3B%7D%7D%0D%0Afunction%20clickN S%28e%29%20%7Bif%20%0D%0A%28document.layers%7C%7C%28document.getElementById%26%26%21document.all%29% 29%20%7B%0D%0Aif%20%28e.which%3D%3D2%7C%7Ce.which%3D%3D3%29%20%7Balert%28message%29%3Breturn%20false %3B%7D%7D%7D%0D%0Aif%20%28document.layers%29%20%0D%0A%7Bdocument.captureEvents%28Event.MOUSEDOWN%29% 3Bdocument.onmousedown%3DclickNS%3B%7D%0D%0Aelse%7Bdocument.onmouseup%3DclickNS%3Bdocument.oncontext menu%3DclickIE%3B%7D%0D%0A%0D%0Adocument.oncontextmenu%3Dnew%20Function%28%22return%20false%22%29%0D %0A%0D%0A//%20--%3E%3C/script%3E';d=unescape(m);document.write(d);</script>
<!-- ||||| SOURCE CODE ENCRYPTION - END ||||| -->
This is the text on your home page.
<p>
</BODY>
</HTML>
Charles
03-01-2003, 05:14 PM
If you are interested, here's a handy little decrypter for that piece of script:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<title>Decrypter</title>
<form action="" onsubmit="this.text.value = unescape(this.text.value); return false">
<p><textarea rows="25" cols="80" name="text"></textarea></p>
<p><input type="submit" value="decrypt"></p>
</form>
AdamBrill
03-01-2003, 05:49 PM
You might try putting the images up on a free server and then just pull them from there. That way you could find one that has more bandwidth.
jkim2400
03-01-2003, 06:57 PM
Thanks you guys for all this help. I'll try pasting these codes on to my site and see what happens. btw- do I need to put it on the index or on all of the html files??
Thanks so much.
2 peachy
03-01-2003, 07:07 PM
I believe it needs to be on each page
Question of my own interest: don't secure servers disable view-source methods? I've been on a secure server before, and while logged in, I could right click but the "view-source" button did not do anything. I also tried clicking, "View -> Source" from the menu at the top left, which did not work either. However, after a while the secure server, being "secure," logs you out. Afterwhich you are able to view the source fine (you just have to log in and sit there for thirty minutes before you can view source, in other words).
Also, people can still right-click your images, and click, "Properties" to get the image properties.
AdamBrill
03-01-2003, 08:09 PM
Jona - I just went on a secure server and it worked fine for me to view -> source. It worked to right click on it and do it that way, too. I don't know why it wouldn't have worked for you...
Maybe my computer was just acting up.
AdamBrill
03-01-2003, 08:24 PM
That could be. Computers have been known to mess up! :D Mine's kind of in the middle of messing up right now. lol
jkim2400
03-02-2003, 10:34 AM
2peachy,
what does this mean? Sorry, I don't know much Javascript.
When I pasted this on to the index.html file, I got a huge input box, I don't know what I'm supposed to do with it. Could you just briefly explain? Thanks.
<!-- ||||| SOURCE CODE ENCRYPTION - START ||||| -->
document.write('<title>||||| SOURCE CODE ENCRYPTION |||||</title>');
document.write('<frameset rows="100%,*" framespacing="0" border="0">');
document.write('<frame frameborder="0" name="topFrame" src="encrypt.htm" noresize="noresize" />');
document.write('</frameset>');
<!-- ||||| SOURCE CODE ENCRYPTION - END ||||| -->
encription page
<HTML>
<HEAD>
<TITLE>This is your home page.</TITLE>
</HEAD>
<BODY>
<!-- ||||| SOURCE CODE ENCRYPTION - START ||||| -->
<script language=JavaScript>m='%3Cscript%20language%3DJavaScript%3E%3C%21-- %0D%0A%0D%0Avar%20message%3D%22Function%20Disabled
%21%22%3B%0D%0A%0D%0Afunction%20clickIE%28%29%20%2
0%7Bif%20%28document. all%29%20%7Balert%28message%29%3Breturn%20false%3B
%7D%7D%0D%0Afunction%20clickNS%28e%29%20%7Bif%20%0
D%0A%28document.layers%7C%7C%28document.getElementById%26%26%21document.all%29%29%20%7B%0D%0Aif%20%2 8e.which%3D%3D2%7C%7Ce. which%3D%3D3%29%20%7Balert%28message%29%3Breturn%2
0false%3B%7D%7D%7D%0D%0Aif%20%28document.layers%29%20%0D%0A%7Bdocument.captureEvents%28Event.MOUSEDO WN%29%3Bdocument.onmousedown%3DclickNS%3B%7D%0D%0Aelse%7Bdocument.onmouseup%3DclickNS%3Bdocument.onc ontextmenu%3DclickIE%3B%7D%0D%0A%0D%0Adocument. oncontextmenu%3Dnew%20Function%28%22return%20false
%22%29%0D%0A%0D%0A//%20--%3E%3C/script%3E';d=unescape(m);document.write(d);</script>
<!-- ||||| SOURCE CODE ENCRYPTION - END ||||| -->
jkim2400-
One thing to keep in mind if you decide to use this is that it will make your pages entirely unaccessable for users with javascript disabled... Also, as Charles has pointed out, it is very easy to break.
jkim2400
03-02-2003, 10:53 AM
*groans* really?
Well, that's a bummer. I mean, I pasted a JS code that disallows people from righclicking the images, but they still can view my source..
So there is no possible way to secure my bandwidth? Or is the only solution to purchase more bandwidth (my hosting site, only gives a certain amount of bandwidth that I don't think I can increase...)
If only bandwidth stealers didn't exist...
Originally posted by jkim2400
[BSo there is no possible way to secure my bandwidth?[/B]Not really. Like Dave Clark said, if it even can be done, it would have to be done on your host's server... No script can keep people from stealing your bandwidth... :(
jkim2400
03-02-2003, 10:57 AM
hehe, Thanks.
Then I guess the only solution is to increase my bandwidth. Any suggestions on a good web hosting place that offers a lot of MB space and bandwidth?
http://www.dr2.net seems like a pretty good deal.
jkim2400
03-03-2003, 03:34 PM
Thanks for the link. I'll probably have to think about moving (increasing my webspace in a few months)