I constantly use the PHP INCLUDES feature on my site, & recently ran into a problem that I'm not sure is solveable at the moment & I'm hoping someone will have a solution.
I'm aware that PHP INCLUDES is ususally for content that you want to keep constant over many pages, but I use it for modifying the main content of my site.
My home page is basically static (and constant throughout the entire site) except for the main content on the page, the main content is served by the PHP INCLUDES function. In addition, when a link is pressed, the main content changes to reflect the information pertaining to the link that was pressed.
The links on my site resemble this format: index.php?page=tournaments.php or http://www.mysite.com/index.php?page=tournaments.php
The main content area on my page uses the INCLUDES function with the following codes, it allows the main content "news.php" to be swapped with another page selected on the menu links.
<? if ( $page=='' ) { $page="news.php"; $l="?"; } else { $page="$page"; }?>
<?php include("$page"); ?>
Many people using INCLUDES use them to modify Headers/Footers while the rest of the page may have areas using INCLUDES depending on the page being viewed. My dilemma lies in the way the page is served information from a new page that is being loaded.
I would like to have a dynamic banner that is below the header, that also uses INCLUDES along with the main content of the site. Basically, I would like the Banner change depending on the link selected to match the content on that particular page. It didn't sound like a difficult problem at first because most people keep the entire content to be modified as a single file, but I would like to change multiple INCLUDES at the same time between different pages after selecting a link. The solution to my problem should serve content about the loading page (i.e. the banner & main content) from 2 sources, but being displayed at the same time based on the page selected from the menu.
Does anyone have any idea how I could make that work? Any help would be appreciated. Thank you.