Page 1 of 2
no source
Posted: Thu Jul 25, 2002 9:12 pm
by cheatboy00
I want to knwo how to make a person not beable to view source... I know theres a way to do it with java script and opening a new window... but i dont want to do it that way i just want people to go to my site and not beable to view teh source
if you have ideas please help
Posted: Thu Jul 25, 2002 9:15 pm
by protokol
I've seen people to crazy things with JavaScript and the ASCII table to encode characters and do all sorts of mathematical functions to screw with the source. So when you view source, you see a javascript function with a bunch of crazy characters where somewhere inside lies the sequence which defines only the characters which are used on your web page.
But honestly, don't go to such lengths. Just move beyond the fact that people will be able to see your source code on your HTML page. Rest assured however that your .php file will be private and not viewable to curious parties who want to steal your code.
Posted: Thu Jul 25, 2002 10:49 pm
by hob_goblin
Posted: Fri Jul 26, 2002 12:43 am
by gnu2php
Although there's no way to prevent people from viewing the source 100% of the time--after all, they could go to their "temporary internet files"--there are a couple of preventative measures:
- 1. Place your page in a frameset, but use only one frame window (the page itself). That way they can't go to "View source" from the View menu to see the source code.
Code: Select all
<frameset rows="*" framespacing="0" border="0">
<frame src="mypage.php" marginheight="0" border="0" framespacing="0">
</frameset>
2. Suppress the "right-click" event, so they can't right-click and go to "View source."
Code: Select all
function mouse_handler(e)
{
if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) return false;
if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3))
{
alert("Sorry, that isn't allowed.");
return false;
}
}
if (document.captureEvents) // Netscape requires this
{
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown = mouse_handler;
Posted: Fri Jul 26, 2002 1:02 am
by fatalcure
have you guys noticed that in this forum, when you click on "POST REPLY", posting.php, you CANNOT view the source??
Im using MSIE 6.x on WinXP, and right click -> view source doesnt work
neither does view -> source on the file menu
just an observation
Posted: Fri Jul 26, 2002 1:19 am
by Tiimmy
Posted: Fri Jul 26, 2002 1:50 am
by Addler
I havea few already created Java scripts (By me! mwa hahah Java is my hand!!! Thats why I need PHP help.. I just can't grasp it) if you want them, email me:
halo_dreams@hotmail.com - I can give them to you.. they will aid in your hidden source conquest.
However there all right, no matter what if someone wants to see, they will see. There are many ways of getting around it.
Posted: Fri Jul 26, 2002 1:58 am
by twigletmac
Just a question: what's so special about your HTML that needs protecting?
Mac
PS. Javascript is client-side, therefore it can be turned off by a user which will render any Javascript solution completely useless.
Posted: Fri Jul 26, 2002 7:24 am
by Dale
fatalcure wrote:have you guys noticed that in this forum, when you click on "POST REPLY", posting.php, you CANNOT view the source??
Im using MSIE 6.x on WinXP, and right click -> view source doesnt work
neither does view -> source on the file menu
just an observation
Nor can i.. hows it done?
Someone contact Jason he should know.
Posted: Fri Jul 26, 2002 7:41 am
by llimllib
no trouble viewing it in Moz 1.0...I just read the source, and there's no javascript that I saw with the intention of stopping source viewing. Perhaps a bug in IE? If anybody wants to see their javascript I can post the source

Posted: Fri Jul 26, 2002 7:45 am
by twigletmac
Must be a bug - what would be the point in protecting the source code of an open source project

.
Mac
Posted: Fri Jul 26, 2002 7:57 am
by llimllib
Wait, but that means you're saying Microsoft might have a bug? Nah, probably those dang open-source hippies put a virus on the page or something.

Posted: Fri Jul 26, 2002 8:15 am
by Tiimmy
If it's a bug then why doesn't it affect any other pages?

Posted: Fri Jul 26, 2002 8:19 am
by llimllib
Could be that something in the javascript throws the rendering engine off, so it won't print the source. Like I said, there's nothing that I saw in the code that causes that behavior intentionally, but I've been more wrong before.
Plus, let's face it, it's fun to say that Microsoft has bugs; it never gets old

Posted: Fri Jul 26, 2002 8:25 am
by twigletmac
It must have something to do with the frame thingie containing the topic review - I can happily view the source when I go to the edit post bit that doesn't have that review.
If it's not a bug, why would the makers of open-source software try to prevent people looking at the source code of a page? It doesn't make sense, but that's just me (and I've never cared about people being able to 'steal' my source code, by the time they see it it's just a bunch of HTML).
Mac