+ Reply to Thread
Results 1 to 3 of 3

Thread: PHP Include Header/Footer

  1. #1
    Legendary Otaku Sinistra may be famous one day Sinistra may be famous one day Sinistra's Avatar
    Join Date
    Oct 2004
    Location
    Radford VA
    Posts
    2,528
    Thanks
    0
    Thanked 3 Times in 2 Posts

    PHP Include Header/Footer

    This is a real simple Tutorial This tut will help you make a easy way to update site links on the fly. all you need is 3 files

    Now to get started.

    your Header will be your most inportent part because it has to include your CSS if you have any astablished.

    OK to get started on this you will need your favorate text editor. Dreamweaver and notepad are great tools for HTML coding. Now create a new file call it header.php and paste the fallowing.

    Example header
    HTML Code:
    <html>
    <head>
    	<title>Enter Title Here</title>
    <link rel="stylesheet" href="style.css" type="text/css">
    <STYLE type="text/css">
    <!--
    BODY {
    scrollbar-face-color: #E8EAFF;
    scrollbar-highlight-color: #A3B0F1;
    scrollbar-3dlight-color: #454E7B;
    scrollbar-darkshadow-color:#434D35;
    scrollbar-shadow-color: #C0C9F6;
    scrollbar-arrow-color: #000000;
    scrollbar-track-color: #B9C2E5;
    }
    -->
    </STYLE>
    </head>
    
    <body background="back.jpg">
    <table width="700" border="0" cellspacing="0" cellpadding="0" align="center"
    class="outline">
    <tr>
    <td class="botline"><img src="wink.jpg" width="755" height="200"></td>
    </tr>
    <tr>
    <td>
    <table width="104%" border="0" cellspacing="3" cellpadding="2" name="body">
    <tr> 
    <td valign="top" width="127"><!--start left navagation-->
    
    <table width="100%" border="0" cellspacing="1" cellpadding="1" class="outline"
    name="menu">
    <tr>
    <td class="head"> Name</td>
    </tr>
    <tr>
    <td class="menuBody">|+|<a href="http://www.link.com"> Link</a><br>
    |+|<a href="http://www.link.com"> Link</a><br>
    |+|<a href="http://www.link.com"> Link</a><br>
    |+|<a href="http://www.link.com"> Link</a><br></td>
    </tr>
    </table>
    <br>
    <table width="100%" border="0" cellspacing="1" cellpadding="1" class="outline"
    name="menu">
    <tr>
    <td class="head"> Name</td>
    </tr>
    <tr>
    <td class="menuBody">|+|<a href="http://www.link.com"> Link</a><br>
    |+|<a href="http://www.link.com"> Link</a><br>
    |+|<a href="http://www.link.com"> Link</a><br>
    |+|<a href="http://www.link.com"> Link</a><br></td>
    </tr>
    </table>
    <BR>
    <table width="100%" border="0" cellspacing="1" cellpadding="1" class="outline"
    name="menu">
    <tr>
    <td class="head"> Name</td>
    </tr>
    <tr>
    <td class="menuBody">|+|<a href="http://www.link.com"> Link</a><br>
    |+|<a href="http://www.link.com"> Link</a><br>
    |+|<a href="http://www.link.com"> Link</a><br>
    |+|<a href="http://www.link.com"> Link</a><br></td>
    </tr>
    </table>
    <!--end of left navagation--></td>
    <td width="455" valign="top" class="outline">
    It should give you something like this..

    header.php View
    as you can see your header is your main logo and your left side link bar

    Now Lets create a new file and call it footer.php.

    and paste the fallowing..

    HTML Code:
    </td>
    <td valign="top" width="151"><!--start right navagation-->
    <table width="100%" border="0" cellspacing="1" cellpadding="1" class="outline"
    name="menu">
    <tr>
    <td class="head"> Name</td>
    </tr>
    <tr>
    <td class="menuBody">|+|<a href="http://www.link.com"> Link</a><br>
    |+|<a href="http://www.link.com"> Link</a><br>
    |+|<a href="http://www.link.com"> Link</a><br>
    |+|<a href="http://www.link.com"> Link</a><br></tr>
    </table>
    <br>
    <table width="100%" border="0" cellspacing="1" cellpadding="1" class="outline"
    name="menu">
    <tr>
    <td class="head"> Name</td>
    </tr>
    <tr>
    <td class="menuBody">|+|<a href="http://www.link.com"> Link</a><br>
    |+|<a href="http://www.link.com"> Link</a><br>
    |+|<a href="http://www.link.com"> Link</a><br>
    |+|<a href="http://www.link.com"> Link</a><br></tr>
    </table>
    <br>
    <table width="100%" border="0" cellspacing="1" cellpadding="1" class="outline"
    name="menu">
    <tr>
    <td class="head"> Name</td>
    </tr>
    <tr>
    <td class="menuBody">|+|<a href="http://www.link.com"> Link</a><br>
    |+|<a href="http://www.link.com"> Link</a><br>
    |+|<a href="http://www.link.com"> Link</a><br>
    |+|<a href="http://www.link.com"> Link</a><br></tr>
    </table>
    </td>
    </tr>
    </table>
    <img src="bottom.jpg"></td>
    </tr>
    <tr>
    <td height="16" class="outline">&nbsp;</td>
    </tr>
    </table>
    </body>
    </html>
    Footer.php View

    Now Create a file and call it index.php

    Paste the fallowing,

    Code:
    <?php include='header.php'?>
    Content gose here
    <?php include='footer.php'?>
    When you open your index.php on your main site you should get something like this

    Final Design

    I hope this was a big help in your coding and real easy for the beginners to learn.

    ENJOY!
    Last edited by Sinistra; Apr 24, 2006 at 11:01 AM.

  2. #2
    Impossible to gauge! AnataBakaDesu may be famous one day AnataBakaDesu may be famous one day AnataBakaDesu's Avatar
    Join Date
    May 2006
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: PHP Include Header/Footer

    cool !! but, anyone knows a free website that lets you to make a HTML based website but for free? i mean and it will be .net or .com or .org .. not like:
    www.mywebsitenamehere.thewebsiteserver.com/net ... i want it to be directly .net or .com ... waiting for ur post

  3. #3
    You's Trollin Pro Leafblower Champion, Helicopter Champion ketaro is making a name for themselves ketaro is making a name for themselves ketaro's Avatar
    Join Date
    Apr 2005
    Posts
    4,293
    Thanks
    30
    Thanked 38 Times in 36 Posts

    Re: PHP Include Header/Footer

    hey thanks lord k for the info.

+ Reply to Thread

Similar Threads

  1. PHP to img
    By Vampire in forum The Thread Vault
    Replies: 0
    Last Post: Mar 03, 2005, 12:28 PM
  2. Php, How does it work?
    By Macky in forum The Thread Vault
    Replies: 2
    Last Post: Nov 30, 2004, 09:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts