developing site.Selling it.How to hide php code?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

osamafarook
Forum Newbie
Posts: 2
Joined: Sun Nov 24, 2002 3:28 am

developing site.Selling it.How to hide php code?

Post by osamafarook »

I want to develop an web site using php & mysql and then sell this product. But i don't want the buyer to see the php code or know the database structure.In nutshell i want to make my site Very Very secure. How?
Dr. PHP
Forum Newbie
Posts: 11
Joined: Sun Nov 24, 2002 8:46 am

mmm.

Post by Dr. PHP »

Well, you realize the PHP never shows up in the HTML code. The PHP is hidden already and your final product should look just like a hand-coded HTML file with no special scripting in it.
oldtimer
Forum Contributor
Posts: 204
Joined: Sun Nov 03, 2002 8:21 pm
Location: Washington State

Post by oldtimer »

Dr. Php is right. Unless you show him the code he will not know. That is the best part about server side code. You only see what the person wants you to see (Unless you make a mistake :P Stupid > ends up sometimes)

As for the database structure they have no idea as well as that is not shown.
osamafarook
Forum Newbie
Posts: 2
Joined: Sun Nov 24, 2002 3:28 am

Post by osamafarook »

I know that server side scripts don't appear to users. But What if i want to sell the site to a company that will put the site on its server. i want to back the php files so that the people on the server can't see the code of php.
ace2600
Forum Commoner
Posts: 30
Joined: Fri Jun 21, 2002 12:12 am

Post by ace2600 »

I dont know about hiding the code if they will have the file. But you could clutter the code so they cant understand if they look at it and make some of the code not work if they modify it (be creative here on the programming). As for hiding the code, no clue.
Ace
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Genteel Beaux
Forum Commoner
Posts: 28
Joined: Wed Nov 13, 2002 4:07 pm
Location: Alabama

Stupid question

Post by Genteel Beaux »

Why would someone want to encode their PHP scripts? I mean if the PHP scripts can not be viewed from within the browser what is the point? Keep in mind, php is totally new to me (I am an ASP man by day) and I am also new to internet development. I normally create intranet pages.

Is encoding php similar to compiling your code in a dll from a Microsoft point of view????
chaim79
Forum Newbie
Posts: 2
Joined: Mon Dec 02, 2002 4:17 pm

Post by chaim79 »

an option that isn't the best, but an option, do most of your coding in the form of functions and keep your functions all in one place (on your server) then "include" the functions and use them, all they will be seing is the calls to the various functions, but not any of the code.

Now, I'm a newbe to PHP myself so I don't know if that will work or not. I'm using a similer method to keep people from hacking my peronal site, (using functions for everything then having php prepend the functions file which is outside of the directory tree for web pages.)

Erik Ekedahl
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

1: I think legally if your PHP code is a central part to the site you are selling.. the person/company you are selling the site to is also buying the code. You can't just sell part of a site.

2: Why would you be worried about the person/company buying the site leaving it 'open' on their server.. it's up to them what they do with it once they have purchased it.


As I see it the only reason you would want to hide the code on the site you are selling is if you have some dodgy code in their.. reading their e-mails?.. sending copies of any 'secure' forms to yourself?.. having your own external control over the site?

Be very careful otherwise you will end up behind bars!
evilcoder
Forum Contributor
Posts: 345
Joined: Tue Dec 17, 2002 5:37 am
Location: Sydney, Australia

Post by evilcoder »

Yeh, that or its just a total rip off of other peoples code. Like a whole site made up of copyrighted code, and he doesn't know how to strip itof its original copyright code. hahaha thats probably the scenario.
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

evilcoder wrote:Yeh, that or its just a total rip off of other peoples code. Like a whole site made up of copyrighted code, and he doesn't know how to strip itof its original copyright code. hahaha thats probably the scenario.
Please don't make assumptions like this of other members...

Volka gave some good links, but when it really comes down to it; any smart business would not buy from you if you secured your code like that. PHP was meant to be open source, I don't know why people are trying to stray from that.
LetterJ
Forum Newbie
Posts: 8
Joined: Fri Nov 01, 2002 10:57 am
Location: St. Paul, MN

Solution

Post by LetterJ »

The best solution from a cost/benefit perspective is to use ionCube's encoder product. It's similar to Zend's (the people in charge of PHP) encoder product. Both of them "compile" your PHP into gibberish. The code is decoded by a free decoder in the case of ionCube and the Zend Optimizer in the other case. The primary benefit to ionCube is that you can just pay for scripts to be encoded one at a time for much less than the several hundred to over a thousand for the standalone versions of the encoders.

What you do is encode a version of your script which is given to your customer or client. Your client will need to install the decoder on their server. Your script will then work on their server.

Go to ioncube.com.
User avatar
Elmseeker
Forum Contributor
Posts: 132
Joined: Sun Dec 22, 2002 5:48 am
Location: Worcester, MA

Post by Elmseeker »

Gen-ik said:
1: I think legally if your PHP code is a central part to the site you are selling.. the person/company you are selling the site to is also buying the code. You can't just sell part of a site.

2: Why would you be worried about the person/company buying the site leaving it 'open' on their server.. it's up to them what they do with it once they have purchased it.


As I see it the only reason you would want to hide the code on the site you are selling is if you have some dodgy code in their.. reading their e-mails?.. sending copies of any 'secure' forms to yourself?.. having your own external control over the site?
What if he just wants to protect his copyright? If what you are saying here is the only reason someone would want to hide their code from someone is to rip them off or something else not quite right then all software companies are dodgy, shady and crooked. I believe what he is trying to do is develop a site and then allow them to use the code but not modify or reuse it. Sort of like writing something in C++ and compiling it and giving your client only the executable. As for the legalities of it, he's the copyright holder to anything he codes, just as you and I are for anything we code, so he can basically do whatever he wants with it...

Take care everyone, Merry Christmas!
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

I guess we should just all agree to disagree on this one.. and stop this turning into one of those never ending 'to copyright or not to copyright, that is the question' posts.

To keep the code hidden I think trying the include() function would be a good idea, haven't tried it myself but it sounds like a good way around it.

Anyways,

Have a happy Xmas ya'll.
kcomer
Forum Contributor
Posts: 108
Joined: Tue Aug 27, 2002 8:50 am

Post by kcomer »

Good job evilcoder, make assumptions, thats great.

As for answering your questions. To hide the db structure of mysql, I don't think it can be done. But hiding php can def be done. I work for a company writing software thats for a very small market and we are planning to sell the software once we have it working for us 100%. I have been testing the Zend Encoder and it works great for both Unix and Windows and only needs the Zend Optimizer installed on the clients machine. Most companies don't mind installing Zend Optimizer becuase of its ability to increase the speed of the scripts. We aren't sure if were going to sell the app ASP style or on a cd. But the Zend Encoder product works great to hide your code. As for the MySQL databases, you're on your own. But let me know if you find anything out.

I suppose evilcoder will think I stole all my code too, but that's fine.
Post Reply