Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

124
Vistas
How to dynamic insert the header and footer of mainpage.html on other pages?

I looked for many examples of how to display the same header and footer from one page to others dynamically without having to repeat the same html code and style.

And unfortunately I couldn't find a clear example of doing this, I've seen that it's possible using PHP, but I haven't found any practical examples.

I will be very grateful if anyone can give me an example or an article about.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

you could use include() for php, you have the header in one page and your footer in other. header.php somthing like

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
</head>
<body>

footer.php

<footer>
  <p>Author: Hege Refsnes</p>
  <p><a href="mailto:hege@example.com">hege@example.com</a></p>
</footer>
</body>
</html>

every other page

<?php include 'header.php';?>
<div>
your content...

</div>
<?php include 'footer.php';?>

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda