php source code protection

They have: 2 posts

Joined: Mar 2005

hi
is thear any way to protect my php source online
i have made a script that i want to use it in my website only and i dont want any one to rip

is thear a way !!!

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

People won't be able to see your PHP source code unless you actually show them by saving it as a .phps file.

CptAwesome's picture

He has: 370 posts

Joined: Dec 2004

well, saving it as anything other than a php enabled extension on your server will allow it to be seen, but people will only be able to see the end result because it's server side.

They have: 4 posts

Joined: Mar 2005

This is a php encryptor:

http://www.ioncube.com/online_encoder.php

Seems good to me, but I'm by no means an expert. I've noticed that some software vendors use ioncube encoded scripts for their key files.

You can try it with a simple file first.

Regards

Harry Smiling

Busy's picture

He has: 6,151 posts

Joined: May 2001

encrypting php or any web site files is more trouble than it's worth, editing, modifing or replacing is a nightmare.
If the orginals are ever lost, the pages must first be un-encrypted (if possible) then re-encrypted when done.

As mentioned above, no one can see the source of a server side file (unless server adjusted or you adjust to show), if you don't believe us, try the following, just copy and paste and name the page testcode.php and upload to your server

<?php
/* this is a comment */
echo "Hello, you are now reading me";
/* my secret is very secret and only I will know it, the secret is ... */
echo "<h1>My secret is:</h1>";
// this is also a comment
// changed my mind, I'm not going to tell you that my secret is "post-it notes"
$a = 2;
$b = 2;
$c = $a - $b;
print
$c;
?>

what you will see in the source code (view/page source) of the above is:

Hello, you are now reading me
My secret is:
0

CptAwesome's picture

He has: 370 posts

Joined: Dec 2004

one addition to Busy's comment, if you don't have php enabled on the server, it will show the php source.

They have: 4 posts

Joined: Mar 2005

I agree with Busy's observation:

"If the orginals are ever lost, the pages must first be un-encrypted (if possible)"

So by encrypting a file you can end up blocking yourself when you come to doing some editing and updating, unless you know how to unecrypt it or are meticulous about keeping an unecrypted copy somewhere "safe".

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.