I'll call you back again to another lecture in PHP.
And in this video lecture I'll go ahead and teach you about include HTML in PHP.
Okay, so in PHP you might want to be able to partition your files into different segments.
Maybe you want to create a header file and then want to create body and footer and order parts like
blocks and code into different files.
Let me say I'm building a website, and I want to have the header file or the header to be in a file.
I want to have the footer to be in a file.
I want to have the body to be in another file, and I want to have the blog page to be in another file.
So instead of building everything in just one file like site dot php, having the header, the body,
the footer, the block, everything, and uh, it might look like, wow, this is really not going to
be good if you want to manage that website tomorrow.
Now I created different files.
One is header dot HTML.
Another is welcome to PHP Website.
And I have another one that says beautiful website, that is the body dot HTML.
And I have the footer dot HTML and it says, uh, all rights reserved.
Now I can go to my HTML site and I can say, this is where I'm building my HTML document.
And this file.
I'll go ahead and uh, put in HTML and then I'll go ahead and close that.
Now I have this thing right in here.
I can build import in the the header file.
First I'm going to say the header.
I'll go ahead and just use what is called include.
And then go ahead and put this in a string format.
And I'll go ahead and say header dot HTML.
If I should save this and go run this code we have.
Welcome to PHP website.
So if I want to actually change anything on that here let me say I have this header is too big and I
want to go here.
I can go right into the file and maybe I can reduce this to H2 and uh do that.
This is a H2.
I can now go ahead and save this without touching sites dot php.
If I refresh this, you can see that this has been amended and we have this in one line.
Welcome to PHP website.
So in that way it will be easier for you as a developer to manage your site.
You can actually go to different pages and work on them without touching this array.
So I can actually go back right here and copy this.
And then I'm going to paste that from body dot HTML.
And if I should go ahead and change the body I'll go ahead and put this to be body dot HTML.
So remember that this is just a template.
And you can actually go ahead and make yours to be very beautiful.
So you can see that the body has beautiful website.
And that is what I put inside this body dot HTML and it's printed out.
Now you can also put in the footer.
I'll go ahead and paste this right in here.
I'll go ahead and change this to HTML.
And let's go ahead and save this and refresh.
And you can see all rights reserved.
In that way I was able to actually build a full website.
And you can see I have my header, I have my body, I have my footer and they are really amazing, so
I can be able to actually go on the header and do whatever I want to do right in here.
And for the body, I can actually go right in here and do whatever I want to do.
And for the footer, I can actually do whatever I want to do.
So I created all these in the same folder where I have cited that PHP, and it was able to actually
look for the file within the folder and be able to put whatever that is in there.
So what do I have in there to render that for you?
And that is why we have this beautiful website.
Wow, this is a beautiful website.
I literally love it.
All right.
So go ahead and put it down, take it out and practice with it so you can be able to try as much as
possible to actually do more on this.
In that way you can actually organize your website files and for now, all you need, you go ahead and
look for the file and be able to modify that or manage it the way you want.
And that is going to be all for now.
So quiet practice.
If you have any questions on this, please go ahead and use the question and answer section.
And I'm going to get back to you as soon as possible.
Thank you so much.
And I'm going to see you in the next video lecture.