Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jan 2012
    Location
    Nigeria
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Html header & footer

    Hi guys, please i need help here.
    Am kinda a newbie in web designing. I recently decided to create a website for my personal use, which would enable me develop my skill. Now my request is this; "is it possible to create a header and a footer?" I know its possible with <table> element, but i dont wana style it with table. I made some search and found out that its possible with php or ruby, but am not that good in those languages. I wana know if its possible to do it with just html or maybe html+css. Thanks in advance.

  • #2
    Regular Coder dan-dan's Avatar
    Join Date
    Aug 2009
    Location
    England
    Posts
    483
    Thanks
    22
    Thanked 79 Times in 78 Posts
    How is it possible using tables?

    Either way, I think it would be pretty simple to add include 'header.php'; to a PHP file. All you need to do is change the file extension from HTML to PHP and add some <?php ?> tags for your PHP.

  • #3
    Regular Coder dan-dan's Avatar
    Join Date
    Aug 2009
    Location
    England
    Posts
    483
    Thanks
    22
    Thanked 79 Times in 78 Posts
    To add:
    You don't really need to know PHP to use HTML based PHP files.

    Simply write the HTML and use the PHP file extension

  • #4
    New Coder
    Join Date
    Jan 2012
    Location
    Nigeria
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks. Buh i didnt get the include header.php aspect

  • #5
    Regular Coder dan-dan's Avatar
    Join Date
    Aug 2009
    Location
    England
    Posts
    483
    Thanks
    22
    Thanked 79 Times in 78 Posts
    Quote Originally Posted by Lil_Kins0 View Post
    Thanks. Buh i didnt get the include header.php aspect
    Sorry, I really wasn't that clear.

    You can't do this with HTML alone, you need to use a server side language like PHP.

    Creater your header/footer in normal HTML, then save it as eg: header.php.

    Now in your index page you should name it index.php then at the top of the page write
    <?php include 'header.php'; ?>

    Do the same for the footer. Anything in between can be written as normal HTML.

    Most importantly, you need your PHP to be interpreted. Is your site hosted locally?
    Last edited by dan-dan; 03-05-2012 at 01:53 AM.

  • #6
    New Coder
    Join Date
    Jan 2012
    Location
    Nigeria
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks. Lemme try it now

  • #7
    New Coder
    Join Date
    Jan 2012
    Location
    Nigeria
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks alot. Worked perfectly.


  •  

    Posting Permissions

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