From the course: PHP for Web Designers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

What are server-side includes?

What are server-side includes? - PHP Tutorial

From the course: PHP for Web Designers

Start my 1-month free trial

What are server-side includes?

Server-Side includes one of the most powerful features of PHP. Simply put, they do the same for HTML as external style-sheets do for CSS. Just change one file and it updates the content of all associated files. Let's take a look at a really simple example. I've loaded this page into a browser. And I'm just going to zoom in, so we can see the text more clearly. The first paragraph says that it's in the original HTML. But the second paragraph says it's in an external file. And then the third paragraph says it goes back to the original HTML. So let's view the page source. If you look at line 12, that's the paragraph that says, it's in an external file. But it looks as though it's an integral part of the HTML. Let's go back to our page, and look at page two. Here, the first paragraph says, it's in an external file. The second one is in the original HTML. And if we check the page source again, line 12, that's the paragraph that's in the external file, but it looks as though it's an…

Contents