dudepet39
03-28-2005, 11:15 PM
Ok, so you've heard of a thing called Includes..or PHP Includes? What is it? And how does it work? Well lets say..for example:
You have a page..a simple page..
<html>
<head>
<title>My site! : )</title>
</head>
<body>
Hello welcome to my siteh!! : P
Navigation: Page Page Page Page Page Page
</html>
</body>
And..you have all those PAGES AND YOU HAVE ADDED A NEW PAGE..AND YOU HAVE TO ADD THE LINK TO EVERYYYY SIINNGGLLE PAGE..right? Horrible horrible horrible...:P. Well..PHP Includes exterminates that stress and AGINY!! You just have to add one single PHP code to all your pages ONCE.
So what your really doing is breaking up your layouts coding and putting it into seperate pages. So..:
header.php (the top of your layouts coding)
<html>
<head>
<title>My site! : )</title>
</head>
<body>
CONTENT..
navigation.php
Navigation: Page Page Page Page Page Page (links)
footer.php (the bottom of your layouts coding)
</html>
</body>
So..on every page of your site you would add
<? include("http://www.yoursite.com/header.php") ?>
Your pages content here..
<? include("http://www.yoursite.com/navigation.php") ?>
<? include("http://www.yoursite.com/footer.php") ?>
You add that to all your pages once.
So your really just WRAPPING them ARROOOUUNNDD your content allready on your page. And when you want to add a link to the Navigation part of your site..you would go into navigation.php and add the link. And the pages you put the include code on (ushually all your pages) the link will show up! On ALL of the pages. And thats it..: P. If you want to change the layout just create your layout first and break it up and just erase the old layout in your actual files header.php, navigation.php, and footer.php and paste the new code in there! And there you go you got a new layout!! I hope I helped you understand and to use PHP Includes..thanks for reading..: ).
You have a page..a simple page..
<html>
<head>
<title>My site! : )</title>
</head>
<body>
Hello welcome to my siteh!! : P
Navigation: Page Page Page Page Page Page
</html>
</body>
And..you have all those PAGES AND YOU HAVE ADDED A NEW PAGE..AND YOU HAVE TO ADD THE LINK TO EVERYYYY SIINNGGLLE PAGE..right? Horrible horrible horrible...:P. Well..PHP Includes exterminates that stress and AGINY!! You just have to add one single PHP code to all your pages ONCE.
So what your really doing is breaking up your layouts coding and putting it into seperate pages. So..:
header.php (the top of your layouts coding)
<html>
<head>
<title>My site! : )</title>
</head>
<body>
CONTENT..
navigation.php
Navigation: Page Page Page Page Page Page (links)
footer.php (the bottom of your layouts coding)
</html>
</body>
So..on every page of your site you would add
<? include("http://www.yoursite.com/header.php") ?>
Your pages content here..
<? include("http://www.yoursite.com/navigation.php") ?>
<? include("http://www.yoursite.com/footer.php") ?>
You add that to all your pages once.
So your really just WRAPPING them ARROOOUUNNDD your content allready on your page. And when you want to add a link to the Navigation part of your site..you would go into navigation.php and add the link. And the pages you put the include code on (ushually all your pages) the link will show up! On ALL of the pages. And thats it..: P. If you want to change the layout just create your layout first and break it up and just erase the old layout in your actual files header.php, navigation.php, and footer.php and paste the new code in there! And there you go you got a new layout!! I hope I helped you understand and to use PHP Includes..thanks for reading..: ).