How do I trigger a div based on the page name.
I would like to show a different php response in the same div based on the page name.
I am thinking something like:
<?php
$pageName = basename($_SERVER['PHP_SELF']);
if ($pageName == 'index.php') {
include("http://website/reponse-from-script-1);
} else if ($pageName == 'index2.php') {
include("http://website/reponse-from-script-2);
} else if ($pageName == 'index3.php') {
include("http://website/reponse-from-script-3);
}
?>
This is because the structure of all the pages is:
<html lang="en">
<head>
<?php include("includes/head.php");?>
</head>
<body>
<?php include("includes/top");?>
<div id= content>
<?php include("includes/content.php");?>
</div>
<?php include("includes/footer");?>
</body>
</html>
I want to use this structure to all the pages and I want the div "content" to change based on the page title.
Any help will be appreciated.
Thank you
---------UPDATE 2---------- This is my code:
<!DOCTYPE html>
<html lang="en">
<head>
<?php include("includes/head.php");?>
</head>
<body>
<?php include("includes/scripts.php");?>
<div id="wrapper">
<?php include("includes/navandsidebar.php");?>
<?php include("includes/main-menu.php");?>
<?php include("includes/secondary-menu.php");?>
<?php include("includes/working-space.php");?>
</div>
</body>
</html>
This code is for all the pages except that this 2 sections changes, thats why i want to trigger the the div "internally".
<?php include("includes/secondary-menu.php");?>
<?php include("includes/working-space.php");?>