Please could you advise me about file structure.
My structure is currently the following:
Inside main root folder:
index.php
profile.php
inbox.php
users.php
…
Each main php file has two parts. On top only php which gets all data, handles $_POSTs etc., below I display html without and with php.
Each file has sections. For example profile.php has aboutme, friends, comments, …
I do this by the following way:
//top
if ($_GET[section]=="aboutme"){
include_once('includes/profile/aboutme_php.php');
}elseif($_GET[section]=="comments"){
include_once('includes/profile/comments_php.php');
}
//...
//below
?>
<html>
<?
if ($_GET[section]=="aboutme"){
include_once('/profile/aboutme_html_php.php');
}elseif($_GET[section]=="comments"){
include_once('includes/profile/comments_html_php.php');
}
//...
?>
</html>
So each bigger page has own folder inside includes folder where are files for each section. Similar is with header and footer, but because they are common to all pages, I have it in includes without subfolder.
Each file have included also settings.php. Settings.php is located outside root for security reasons. And inside settings.php are included functions.php and language.php.
Is ok to have include in parent include (functions.php>settings.php>profile.php)?
Is ok to have in this case for example comment in includes/profile/comments_html_php.php?
Is this common and ok to use this way?
Tnx!