Web Dev Roadmap for Beginners (Free!): https://bit.ly/DaveGrayWebDevRoadmap
This tutorial will use PHP include and require statements to add a PHP header and footer to a web page. You will learn the difference between include and include_once as well as require and require_once. We'll also look at how to make a conditional include in PHP.
Subscribe https://bit.ly/3nGHmNn
PHP is a backend development language that runs on a server. I suggest installing the XAMPP development server. Here is my guide to getting XAMPP set up: https://youtu.be/btauAEqaifw
Install XAMPP https://www.apachefriends.org/
This tutorial is part of my PHP and MySQL for Beginners Playlist: https://www.youtube.com/playlist?list=PL0Zuz27SZ-6MeRUt-z60DRxNqcrFAUYIb
(0:00) Intro
(0:24) Start Apache in the XAMPP control panel
(0:54) The structure of the page
(2:08) Creating a view folder
(2:30) Creating a header php file
(2:58) Include the header file
(4:55) The difference: include vs require
(5:25) Creating a footer php file
(6:54) Creating an alternate header php file
(8:26) Adding a subdirectory to the view folder
(9:17) Conditional include
(13:52) include_once and require_once
Learn Web Dev at these sites:
https://www.freecodecamp.org
https://www.theodinproject.com
Follow Me:
Twitter: https://twitter.com/yesdavidgray
LinkedIn: https://www.linkedin.com/in/davidagray/
Hashnode: https://yesdavidgray.hashnode.dev/
Reddit: https://www.reddit.com/user/DaveOnEleven
Was this tutorial about include and require statements helpful? If so, please share. Let me know your thoughts in the comments.
#php #include #require