Example with PHP
This example is great, as well as being very easy to implement on your site, it is easy to maintain. iframes force the server a lot.
You will have to create your page in PHP as you will use the command require_once.
First of all, create your PHP page. Ex: index php.
Within the index php., you can put the require_once anywhere on the page, even on meta-tags.
Ex:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="pt-BR" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Aqui irá ficar o título da página</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<p>
HTML normal pode ser usado na pagina.
</p>
<!-- puxa o código do arquivo conteudo.php como se fosse um frame/iframe, só que ele renderiza a página como se o código dentro de conteudo.php fosse da própria página -->
<?php
require_once "conteudo.php"
?>
<!-- Você pode adicionar quantos, e onde quizer -->
</body>
</html>
Now let’s create the archive php content.
Inside it we will put what will appear on the previous page we created. (a index.php)
<p>
Isso é um texto, esse mesmo texto irá aparecer na página index.php como se esse texto fosse da própria página.
</p>
<a href="https://google.com"> Isso é um link que vai para o Google </a>
Now, when you access the page index php., will show the contents inside php content..
This is undoubtedly the best alternative, I only use so on my websites.
Obs: The browser does not read PHP files locally (i.e., on your computer). If you open the browser on think that if the code did not work because it is broken, because the code is right. The problem is that browser does not run PHP locally. See below:
In order for you to see your normal page, it will be necessary that these files are guest on a server, or you can install a WAMP so you can run PHP on your computer. I recommend XAMPP, without a doubt is the best. You can even install on your computer some CMS’s like: wordpress, joomla, drupal, etc..
I think "unique" is a rather strong word for the case.
– Oralista de Sistemas
@Renan you’re right, I even added another solution.
– Paulo