Last Updated: February 25, 2016
·
837
· cskiwi

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 :)

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Related Tags
#php
#html
Did you know?

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