Jump to content

Quick web structure question?


Solarpitch

Recommended Posts

Hey,

Is it a good idea to have all of your database code, functions and what not in one Master php file which is used buy all pages in your site to access for querys and calculations. So in all the other pages you just include the "Master.php" file and reference the function in that Master page, pass information to it and return calculations and querys?
Link to comment
https://forums.phpfreaks.com/topic/26495-quick-web-structure-question/
Share on other sites

It doesnt make a whole lot of difference. PhP code is executed server side, so the end user cant see the code anyways. Also, having one huge file makes every page a burden on the system, as it has to load the entirety of all the code every time a new page is loaded.

The rest is just a matter of you, the developer, navigating one monstrous .php file.

I suppose I could break the Master php file into 4 or 5 mini "master" files grouping related functions and procedures together. ie . . have one that handles database querys . . another one that does calculations and if statements etc?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.