Hello,
I am a beginner in PHP. I would like to know more about optimizing my server side php codes. This is a general post and there may not be a direct answer to this, so I would be thankful for any sort of help on this.
I usually create a
- login.php
- LoginClass.php
Since I do not know to submit a form data directly to a CLASS so I use login.php to get the $_POST data from the form. Once login.php receives the data it then sends the data to LoginClass.php for the actual login processing.
Similarly I usually create
- signup.php
- SignupClass.php
Since LoginClass.php and SignupClass.php needs to access database, I usually have the database codes as private function in each of this CLASS pages.
Is there any better way to do this? for example, using a abstract class and extending to each of these files?
Or how do you usually handle this things in your programming?
Thank you.