I have developed a full database oriented CMS in PHP for my client. I have them hosted on some temp hosting of mine now but what if he asks the code then also am i liable to give him?
It depends on your contract but he owns one license to use and so you should give him one copy and also you can give him encrypted PHP code as well if you have nothing in contract
Look at the wording on the contract. If the client has asked for you to develop a CMS AND has asked for the source code, then you are obligated to provide everything. If, however, the client has paid to use the CMS you have developed AND the licence the client has paid for is to use the CMS and pay for hosting, then you are not obligated to provide the source code. As the author you own the Intellectual Property Rights (IPR) to the application. If the client wants to host a version of the CMS on an internal server (i.e. still wants to use the CMS but does not want to pay for you to host it), invest some money in a good PHP obfuscator. If there is no contract (i.e. verbal agreement), get one drawn up quickly and re-negotiate the terms .... and get it in writing !!!