The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> HTML common pill file
scott449
post Jul 5 2020, 12:10 PM
Post #1





Group: Members
Posts: 3
Joined: 30-June 20
Member No.: 27,415



I have several web sites
They all have a common footer
Is there way to have a common “footer file” then insert some HTML code into all my pages that pills the “footer file” in the footer section of each page.
Huge pain in the ass to update all my footers

this would alos be usefull for other parts of my sites that have common information that is updated regulary

TIA
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
Christian J
post Jul 6 2020, 06:36 PM
Post #2


.
********

Group: WDG Moderators
Posts: 9,659
Joined: 10-August 06
Member No.: 7



QUOTE(scott449 @ Jul 5 2020, 07:10 PM) *

I have several web sites
They all have a common footer

You mean on separate domains, or just different pages on the same domain?

QUOTE
Is there way to have a common “footer file” then insert some HTML code into all my pages that pills the “footer file” in the footer section of each page.

On a single website it's easy, for example here's all the PHP code needed to include the contents of the text file footer.txt:

CODE
<?php include 'footer.txt'; ?>

You may also need to give the HTML files a .php extension instead of .html, though that can be changed.

If you want to include a file from another domain, your server's PHP module must be configured to allow that in https://www.php.net/manual/en/filesystem.co...low-url-include this might be up to your webhost support, not sure.

See also https://www.php.net/manual/en/function.include.php
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th April 2024 - 05:44 PM