I like to script php, and lately i was looking for a way to create a 100% dynamic page in php, with the least possible overhead and create a rich user experiance.
I say this is a "New" PHP structure because I have come up with the idea myself, that does not go to say that no one has come up with this before me.
The structure is simple in its conception, by using 2 variables, one is whether the user is logged on and the other is whether the user has requested a specific page.
The main page, simply index.php in my case, is what i would refer to as a key page. without the first page none of the links on any other pages will work if they are made in a relative position to the first page.
By using the PHP include statement you can include the page with the name equal to the pagename variable i mentioned above, thus the "key" page can be a shell for the rest of the pages to be included into and you can have a whole website based on a single page name, in my case index.php.
as i said, the coding behind the paging was simple:
at the beggining of the page:
<?php session_start(); $loggedin=@$_SESSION['loggedin']; ?>
and in the space you wish to have the data incorporated into the shell:
<?PHP
$pagename=@$_POST['page'];
if(Empty($loggedin) && Empty($pagename))
include("NLI.php");
if(Empty($pagename) && !Empty($loggedin))
die('<center><h3>ERROR: There seems to be an error in the page you are vieweing</h3><br>please report this error code: 1001</center>');
if(!Empty($pagename))
include("$pagename");
?>
Where loggedin is a simple binary variable, stating weather they are logged in or not, and pagename is the page to display if they are logged in, the site is operated by forms and session variables.
I really enjoyed creating this site, and in my own opinion, i would think this would increase the security of the site itself, but im still a novice at PHP and i hope someone finds this information useful!