Click to See Complete Forum and Search --> : Source Protection


Jick
06-19-2003, 10:33 PM
How can I totally protect my website source code from any and all eyes. I want it so you can't see my source even if you go to View/Source on the Explorer and I don't want people to be able to right click and see it either! Please help. :D

pyro
06-19-2003, 10:38 PM
It can't be done. There is no way to disable view->source. You can disable the right click, but since you can't disable view source, I wouldn't recommend doing it. Bascally, anything that you put up on the 'net is available for all to see.

Jick
06-19-2003, 10:40 PM
I was just thinking that if you made you page a PHP file you could somehow hide it but I guess I was wrong! I thought I saw someone do it once before! :p

pyro
06-19-2003, 10:42 PM
Your PHP source will be entirly hidden (except any output). Guess I should have mentioned that... ;)

So, if I have this:

<?PHP
$var = "test";
echo $var;
?>

All you can get it "test" as that is all it outputs to the browser.

Jick
06-19-2003, 10:51 PM
What if I left out the echo part?

<?PHP
$var = "test";
?>

I would think that if I put my whole page source as in the $var then it would hide it! :confused:

pyro
06-19-2003, 10:52 PM
Yes, it would, but how are you going to get the info in $var to the browser?

Jick
06-19-2003, 10:54 PM
Thats a good question. You got me! :confused:

pyro
06-19-2003, 10:55 PM
lol... and here is the answer:

You would need to either echo or print it, thus making it so people can veiw the source. There is no way to protect client side code...

Oculus
05-18-2005, 07:59 AM
Your info is incorect, you can view the PHP source (eaven $vars) with a PHP script for source viewing :cool: ! As you should know PHP is opensource scripting language, and because of that no $vars will help! If you want to protect your PHP source you can do it 2 ways.
1. Create an disable your opensource, by using comment scripts, witch will replace your source with the comment you writen...
2. Use PHP encoding programs such as ZEND Encoder to enctryp your source, after such porcess noone will understand what is writen in the PHP or HTML source (it depends on what kind of encoding you chose)
:cool: ;)

BeachSide
05-18-2005, 08:48 PM
Your info is incorect, you can view the PHP source (eaven $vars) with a PHP script for source viewing :cool: ! As you should know PHP is opensource scripting language, and because of that no $vars will help! If you want to protect your PHP source you can do it 2 ways.
1. Create an disable your opensource, by using comment scripts, witch will replace your source with the comment you writen...
2. Use PHP encoding programs such as ZEND Encoder to enctryp your source, after such porcess noone will understand what is writen in the PHP or HTML source (it depends on what kind of encoding you chose)
:cool: ;)

This made no sense to me! :confused:

What does the fact that PHP is an open source scripting language have to do with it? PHP being an open source language only means that the code that is used to create and drive PHP is availible for all to see and manipulate. This does not mean that the "programs" that you write in PHP are open for all to view. For anyone to view your PHP source code you would have to bypass the server. I am not saying that it is not impossible to "grab" the code from the server, there are ways to do this (i.e. if you are on the same server as another site there are techniques to go through the backend and do this) but because PHP is integrated with the server you cannot just grab code at will.