EPISODE · Feb 17, 2016 · 15 MIN
PHP Includes – Talking HTML
from podcast Archives ⋆ Schaffen Creative · host Talking HTML
PHP includes are a vital aspect of websites and should be incorporated into every Web Developer’s workflow. Code via Chris Coyier and the CSS Tricks website Main reason for using a PHP include: All code for a specific function is under 1 roof. If you need to make a change you change it in 1 spot instead of going to each and every individual page When using and creating includes the files need to have the php extension on the file. Index.html turns into index.php Popular includes to create: Footer.php Header.php Navigation.php Other examples: Meta data/ stylesheets/ head information Social media Separate website tracking code if you don’t/can’t include it in the footer. General include statement: <?php include(“header.php”); ?> PHP include statement from root. <?php $path = $_SERVER[‘DOCUMENT_ROOT’]; $path .= “/common/header.php”; include_once($path); ?> DISCLAIMER: when using PHP includes you HAVE TO ensure ALL OF YOUR LINKS are sourced from the root. All internal navigation Direct links from 1 page to another that is not in the navigation Image file locations Generally speaking this is something to get into the habit of doing anyway, that way if you move something you don’t have to remember to fix the link. Also I do believe that this is a general web standard. webdevpod.com @tommnorman @TNPWDesign The post PHP Includes – Talking HTML appeared first on Schaffen Creative.
NOW PLAYING
PHP Includes – Talking HTML
No transcript for this episode yet
Similar Episodes
Mar 26, 2026 ·1m
Jan 2, 2026 ·47m
Dec 21, 2025 ·46m