I am building my first real php web app. as many you know this requires building LOTS of pages.
in attempting to streamline the repetitive stuff i placed most of my stuff within a content.php page which looks like this
<?php include_once ('config3.inc');?>
<?php if(isset($_GET['p'])){
$page = $_GET['p'];
}else {
$page ='';
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $_SERVER['PHP_SELF'];?></title>
<?php include('styles.inc');?>
<?php include('api.inc'); ?>
<?php include('scripts.inc');?>
</head>
<body>
<div id="container">
<?php include ('header.inc');?>
<div><!-- Content -->
<?php include ('./content/'.$page);?>
</div>
</div><!-- end container -->
<!-- Footer -->
<?php include ('footer.inc');?>
</body>
</html>
This way when I want to call up a page I go to www.domain.com/content.php?p=pagename.php and it will "wrap" everything in the correct style sheets container and footer etc.
had been working well until I started making my CRUD pages requiring that pagename use POST data.
Is there a better approach for this or do I need to scrap this approach entirely?