Jump to content

"require/include" in HTML?


Monster RA

Recommended Posts

No.

Edit:

Here's how I think about the scripting languages I use:

HTML is all about displaying the data/message, so the spiders can decide what's there.

CSS  makes the data/message look pretty with some functionality.

Javascript gives the data/message all the functionality it will ever need.

MySQL gets and stores the data/message and shows the foundation of how to begin to think about specific data.

PHP describes the thinking behind the data/message in detail.

GIT is how 1000s of people work together on the data/message and avoid stepping on toes, ideally.

This is meant to be just my conception of code and how I use it.  Feel free to take it, leave it or modify it any way that makes more sense to you!

And...

Have the Best New Year Ever!         

Edited by niche
Link to comment
Share on other sites

On 12/31/2020 at 3:34 PM, niche said:

No.

Edit:

Here's how I think about the scripting languages I use:

HTML is all about displaying the data/message, so the spiders can decide what's there.

CSS  makes the data/message look pretty with some functionality.

Javascript gives the data/message all the functionality it will ever need.

MySQL gets and stores the data/message and shows the foundation of how to begin to think about specific data.

PHP describes the thinking behind the data/message in detail.

GIT is how 1000s of people work together on the data/message and avoid stepping on toes, ideally.

This is meant to be just my conception of code and how I use it.  Feel free to take it, leave it or modify it any way that makes more sense to you!

And...

Have the Best New Year Ever!         

Thank you that is very helpful.  When starting out, it's incredibly overwhelming but to conceptualise as you have is very useful.

I have opted to save my files on to a local server using XAMPP and then to save each .html file as a .php.  This seems to have to done the trip as I can now use the 'include' function.  

 

Link to comment
Share on other sites

  • 4 weeks later...
On 1/1/2021 at 3:55 AM, Monster RA said:

Hi All,

I've seen that in PHP you can include a require or include function which saves you from having to add the entire code for headers and footers for each page. Does a similar things exist in HTML?  If so, please direct me.

Thanks in advance

Russell

Actually you can use server side includes in straight HTML, but you have to enable it.

I've never used it myself as I just use PhP, but I saw a tutorial for it here: https://www.yourhtmlsource.com/sitemanagement/includes.html

 

Link to comment
Share on other sites

I don't think anybody uses server-side includes anymore, since server-side programming languages do that and a whole lot more, and both solutions require having a server configured to execute instructions in the HTML document.

Link to comment
Share on other sites

  • 3 weeks later...

Discovered the JavaScript-powered HTML include process here at W3 Schools almost two years ago, and it has worked very well for me. I've tested the code in Firefox, Pale Moon, Opera, Chrome and MS-Edge (Windows versions only), and it hasn't failed in any of those yet.  Be aware that your desktop, laptop or notebook must have a local server running so that you can see the code working as desired  before you publish your content. Currently, I am using the Laragon Apache Server.

A modest sample of how I have used the JS-HTML include -- Calendar for the Year 2021. In examining the source code, be sure to note the remarks I have inserted at vital places. BTW -- The reference to the XAMPP local server can be ignored, as you may be using that you like better.

BTW -- I've programmed with HTML, CSS, and Javascript but have never used PHP.

Thanx-A-Lot. Stay Safe and Well.

 

Edited by frankosport19
Adding Example
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...