We want to sell our web site script and looking for technologies for make it sell security that one copy can work on one domain name only. Could you please help us with a way to do it?

And one question about it. How to sell script on many "scripts catalogues" web sites? For example, if I need to generate licence code for every buyer, how to do it..?

Web site made in PHP and I would like to keep ability to edit files by buyer, so I do not want to use Zend or other compilers.