i have the solution for you because i do the same in my website.
Its not so difficult to do this but you should have the age perfectly
organized.
The method to add a page into another is the tag "<iframe>"
this is the completly code that i have in my page of the iframe:
CODE
<iframe
allowtransparency="true"
style="FILTER: chroma (color=fafefd)"
name="Main"
src="/contact.php"
SCROLLING="no"
width="100%"
height="600"
align="top"
frameborder="0"
class="wrapper">
Esta opción no trabajará correctamente. Su navegador no soporta IFRAMES.
</iframe>
The code i use in my page is a funtion call if (if you started learning php you should know it),
so suppouse you have 3 pages to add into a page "home.php"(this is your home page)
"page2.php" and "page3.php".
So you open your header and footer page and were you want to see the page you add
something like this code.
CODE
if($seccion=='page2')
{echo '<iframe
allowtransparency="true"
style="FILTER: chroma (color=fafefd)"
name="Main"
src="Page rute 2 EJ: "/page2.php" "
SCROLLING="no"
width="100%"
height="600"
align="top"
frameborder="0"
class="wrapper">
your brouser doent allow iframes.
</iframe>';
}
else
{
if($seccion=='page3')
{echo '<iframe
allowtransparency="true"
style="FILTER: chroma (color=fafefd)"
name="Main"
src="RUTA PAGINA 3 EJ: "/page3.php" "
SCROLLING="no"
width="100%"
height="600"
align="top"
frameborder="0"
class="wrapper">
your brouser doent allow iframes..
</iframe>';
}
else
{ echo '<iframe
allowtransparency="true"
style="FILTER: chroma (color=fafefd)"
name="Main"
src="Page rute home EJ: "/home.php" "
SCROLLING="no"
width="100%"
height="600"
align="top"
frameborder="0"
class="wrapper">
your brouser doent allow iframes..
</iframe>';
};
};
This code vercion i have recently made is not the one i have in my website
because althout it is more easy to understand, it is disorganise.
You can have ilimitate number of pages the only thing you have to do is
to copy one line and add it before:
CODE
{ echo '<iframe
allowtransparency="true"
style="FILTER: chroma (color=fafefd)"
name="Main"
src="Page rute home EJ: "/home.php" "
SCROLLING="no"
width="100%"
height="600"
align="top"
frameborder="0"
class="wrapper">
your brouser doent allow iframes..
</iframe>';
};
,add an "};" at the end, change the variable "seccion" value, and the page rute.
I said to change the variable value because it is fundamental for the page
EJ:
the variable for the page2.php is $seccion=='page2'.
the link to show that page is: http://"yourpage".com/"theheaderandfooterfile".php?seccion=page2
so you can acces all the pages from one only page.
If you find anything in spanish is my fault because my native lenguage is spanish

i hope it was usefull for you
Reply