i am learning php for a few weeks now and wanted to know what programming technique should one use while writing web applications such as a user management system.. i googled about it but still didnt get a clear view whether it should be strictly object oriented like java or may use procedural methods like functions without classes..??
also i had a problem:
a class ‘user’ containing details of a logging-in user such as name , uid, etc and a class ‘dbman’ which has variables and methods to handle database jobs such as verifying username and password and logging in and out entries and other stuff..now a third class ‘usermanager’ is there which is supposed to inherit the above two classes so that users details may be used to drive dbman from within usermanager and data of user and dbman remains hidden and the code remains clean..
but i dont think a class can inherit two classes simultaneously in php..
so i made user and dbman static and created an objects of both in usermanager..is it a good method (i dont think so!!)
what should i do??
thanx for any help in advance..
I would suggest looking into PHP Frameworks. Many of them tend to be OO and use a MVC Design Pattern.
Just google MVC(Model View Controller) and look at a few of the frameworks out there…
my personal favorite is Code Igniter (http://codeigniter.com/), but many other are out there like Cake PHP, Symphony, Zend and many more.
A Framework allows you to reuse code allowing you to focus on the logic that will make your application do what its suppose to.