How to Make a Footer in HTML

If you've seen a website footer that stays consistent across all pages on the site, chances are the website is using PHP includes and has a separate file for the footer. By using PHP includes, a page doesn't have to repeat the same information all over again. It can call in the footer file, for instance, to display the footer instead of having to store that information itself. This saves bandwidth and storage. You can learn to create a footer in HTML and PHP.

Instructions

    • 1

      Create an HTML file containing the information you want in your website's footer. Save this file and call it "footer.php."

    • 2

      Open the file for your Web page and, at the bottom, type this line of code:

      <?php include "footer.php"; ?>

    • 3

      Resave your Web page as a PHP file -- if it isn't one already. This is necessary to let your Web server know that it has to take action on the PHP code.

    • 4

      Upload both your resaved PHP Web page file as well as your footer.php file to your Web host. The next time you visit your Web page, the footer file will appear at the spot on the page you placed the line of code. You can include that line of code in all your Web pages to keep the footer consistent across your entire site.

Related Searches:

References

Comments

Related Ads

Featured