Reputation: 11
I am currently working on a project and I would like to print different HTML pages depending on the selection of the user. Since all pages share the same sidebar and navigation bar I thought I could export them into a different file and always read/show them while also reading the different subsites and showing them.
Here is a little example of the code:
$decision = (isset($_GET["site"])?$_GET["site"]:"default");
switch ($decision) {
case "login":
readfile("login.html");
break;
case "register":
if($isAdmin){
readfile("register.html");
}
break;
default: // Prints the dashboard by default
/* #region To be removed (exists for testing only) */
//readfile("register.html");
/* #endregion */
readfile("dashboard.html");
break;
And since I don't know how I would succeed in showing to pages at the same time which are interconnected I am asking you and I was also wondering if I could send the page information by post and not only by get. Thanks in advance!
Upvotes: 0
Views: 51
Reputation: 11
The solution to my problem was to split my content into several different files and just arrange it in the correct order (suggested by @Adyson)
include_once("header.html");
switch ($decision) {
case default:
include_once("login.html");
break;
}
include_once("footer.html");
Upvotes: 1