I'm a playing around with website building by following the tutorials of user "createthenet", a.k.a. Timothy, on YouTube. The steps to follow are simple enough, but I notice that what he often does is begin with a template, then build pages off of that template.

Not to advertise on his behalf, but I'll use his site as an example. When I click on "Welcome", "About", "Tutorials", etc., most of the site, such as the header area, remains the same.

This saves work when building the site, but suppose I had 50 pages all with the same header area. Then if I decide to change the header area. I'd have to modify 50 files.

Is there a better way of achieving this so that I can modify the header in one file, and it'll be reflected in the other 49?


What you're looking for is generally referred to as an "include". Server side programming languages like PHP and others offer this functionality. All you have to do is create a header or footer file with the common code on it and then "include" it into each page you want to use it.


Ya. John is right. Please refer here for more info http://php.net/manual/en/function.include.php


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.