How to protect web applications

Suppose a person asked me to do a web page with a database to store his transactions. I’ve done that in flash php and mysql. Also consider after buying this from me he sells it to others. So my question is how can I avoid this. I want to sell this application to a number of persons without them re-selling.