I have these two files:
includes.php
Contains the database information, and also performs a few queries (such as to retrive forum information, basic site configurations). Also initiates a database connection.
functions.php
Contains the custom functions that are used in almost every page of the site.
footer.php
Closes the database connection.
Now, whenever I make a new page, I always include INCLUDES.PHP and FUNCTIONS.PHP on top and FOOTER.PHP at the bottom.
Now, my question is, when the user changes pages, does the above files get included again? Does that mean that the INCLUDS.PHP performs all those queries again?
If so, should I use include_once() or require() instead?
Or have like a page where i include all those files, and include the pages that actually changes?
Like display.php?show=news.php
But in that case, news.php also has a query string, so I dont think I can display something like display.php
?show=news.php?id=23
Thanks!