PHP Include and Require | Add a PHP Header and Footer

Dave Gray
Dave Gray
14.8 هزار بار بازدید - 4 سال پیش - Web Dev Roadmap for Beginners
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: How to Install the XAMPP Server for P...

Install XAMPP ➜ https://www.apachefriends.org/

📺 This tutorial is part of my PHP and MySQL for Beginners Playlist: PHP and MySQL

(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: Twitter: yesdavidgray
LinkedIn: LinkedIn: davidagray
Hashnode: https://yesdavidgray.hashnode.dev/
Reddit: Reddit: 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
4 سال پیش در تاریخ 1399/11/07 منتشر شده است.
14,857 بـار بازدید شده
... بیشتر