Easy PHP page include
When you change 1 thing in your HTML layout, you mostely have to change it in most of your pages, here's a quick way to fix that problem.
insert where your content needs to be the following code
switch($_GET['page']{
case "Home":
include("inc/home.php");
break;
case "Profile":
include("inc/profile.php");
break;
default:
include("inc/home.php");
break;
}
now you just have to change 1 time your layout, and it will be corrected on all the pages, YEAY :)
Written by Glenn Latomme
Related protips
Have a fresh tip? Share with Coderwall community!
PHP applications still send a browser full of JavaScript. Hardening the server does not inventory the payment, analytics, and plugin scripts that run after the HTML is delivered.
Security insights from Cside