I have developed some PHP and HTML code for a freelance project, I want to make my contractor able to use my code commercially, since they will sell my project to their own client (an enterprise), but I want to disallow them from recycling my code for further projects, could this be achieved by some GNU license?

Also I want to be able to use my code for another clients I could have (since I'm freelance), and sell them projects with some snippets of my today's created code, 'cause I could use some of this libraries.

  • 4
    I don't think this is off topic. It falls under "matters that are unique to the programming profession" in the FAQ.
    – Keltex
    Jun 15, 2011 at 22:22
  • I would suggest taking a look at the Creative Commons license builder. That might fit your needs.
    – CamelBlues
    Jun 15, 2011 at 22:23
  • Take a look at Zend Guard it's the best way to product your PHP code and enforce the license.
    – Reactgular
    Oct 14, 2013 at 23:50

2 Answers 2


This is a fairly common scenario for developers of all sizes.

Instead of relying on a 3rd party license (which will never fully apply to your scenario), draw up your own license allowing them the commercial use and redistribution of your unaltered code. Explicitly state that they are not allowed to alter the code. Also make sure the license is "non-exclusive". That allows you to re-use your code.

We maintain licenses like this tailored to each of our clients.

  • Ok, I'll definitely get a lawyer, but for later projects because of time, is there any GNU license I could use that disallow someone to modificate the code without explicit permission? just for this time though, later a lawyer, I promise.
    – Andres Duran Kenny-Espinosa
    Jun 15, 2011 at 22:40
  • 1
    All the GNU licenses are OpenSource meaning you grant the receiver the right to change and redistribute the source as they wish. The closest I can see would be Creative Commons licenses, however their application to sourcecode has not yet been proven in court.
    – 0x90
    Jun 15, 2011 at 22:44
  • Can you show me an example license?
    – inf3rno
    Dec 4, 2019 at 2:43

If you release it with a GNU or MIT license on http://sourceforge.net/ , then you (and others) can use it, but can't prevent you from re-using it. The downside is that you can't prevent anyone else from using it, either, because it's open-source.

If you need to prevent someone from reusing your work, you need a custom contract. GNU and (less so) Creative Commons can only make it difficult to reuse with changes if they don't also provide the changed version openly. None of them disallow all reuse by particular parties, or allow use only for particular parties. I don't think there's a viable instant answer for this - you need a lawyer to write up a contract. There might be boilerplate out there with a standard contract on it, but honestly, be careful what you find on the 'net.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.