I make 1 website using this method , the website have 3 column , Left_body.php, right_body.php, body_center.php and header.php and footer.php i make them individual , then i make 1 file name index.php, and use this method to add all in index <?php include ("body_center.php");?> in body_center.php i call all the other html page links with this method else if ($_GET['id'] == "articles"){ include ("centerbody/articles.html"); } else if ($_GET['id'] == "sharfa_shames"){ include ("centerbody/articals/sharfa_shames.html");} i have so many page and links and i dont want to make mess i use this method because when i add any new page i just make that html page in centerbody and include and make link in just body_center.php file , what you think is this method is good?
If you are able to organize your folders and validate user input you can simplify and shorten overall code wordpress is using similar technique
Nothing wrong with that method it's quite common, if it makes it easier to organize things then go for it!
yep, nothing wrong with that code, but if you have, say it one hundred pages, then the code body_center.php will be long enough and it will be increase at the same time when you add more pages. it's not good enough actually from the development point of view. you should try to organize the article in category and then build some static class that handle that category folder and the files in each category folder, maybe by fetch all the files names under the category into static array or something like that and then validate and associated it with the given query string in url. in that way, you will just have to put the file in the folder and no need to change the code every time you add a page in your site...
I agree with iandracaster. Also this way i believe will load pages faster instead of using lots of "else if" statements.