What resource do I find in HTML, as an option to PHP Include?

1

What resources do I find inside an HTML page, to make independent segments of a page (Head, Body, Footer, etc.) just like it happens using include? So that one page was enough, in front of 30 pages that would use the same information.

Thank you all.

    
asked by anonymous 06.03.2018 / 19:33

1 answer

0

According to the W3C documentation there are two ways for you to do this.

  

Sometimes, rather than linking to a document, an author may want to   embed it directly into a primary HTML document. Authors may use either   the IFRAME element or the OBJECT element for this purpose

Documentation about <object> : link

How to use:

<OBJECT data="embed_me.html">
Warning: embed_me.html could not be embedded.
</OBJECT>

Documentation on <iframe> : link

How to use:

<IFRAME src="foo.html" width="400" height="500" scrolling="auto" frameborder="1">
  [Your user agent does not support frames or is currently configured
  not to display frames. However, you may visit
  <A href="foo.html">the related document.</A>]
</IFRAME>

OBS1: For the above two methods there are a lot of peculiarities! Be sure to read the documentation ...

OBS2: Regardless of this I would suggest using include itself and in the latter case, required_once also with PHP

    
06.03.2018 / 20:05