Results 1 to 17 of 17
  1. #1
    Join Date
    Jul 2003
    Location
    Memphis
    Posts
    30

    Question Layout Question - Frams - VS - tables

    I have a pretty basic web page design question.

    I now know some the differences and pros and cons of frames versus tables.

    I am now trying to make my web site in tables. It is a pretty basic website with navigation at the top and content in the bottom.

    When I had done the website befoer I used frames at the top and botton - which made navigation easy. Now when I am trying to do the same thing in tables, how do I handle the navigation?

    Will I just have to have all the same content on every page?

    Thanks in advance.

  2. #2
    Join Date
    Apr 2004
    Posts
    78
    Well you can use magic php to do that. Just create footer.php and header.php and include those with everypage like this:

    PHP Code:
    <? include('header.php'?>
    Normal html or php code goes here
    <? include('footer.php'?>

  3. #3
    Join Date
    Jul 2003
    Location
    Memphis
    Posts
    30
    What is magic php? - Functions built into PHP?

    I have a recent version of PHP on this server.

  4. #4
    Just PHP, forget about the magic thing.

    Create a file called header.php and put the navigation code there.

    Create a file called footer.php and put the footer code there.

    Create a file called mypage.php and place the following code in it.

    PHP Code:
    <? include('header.php'?> 
    Normal html or php code goes here 
    <? include('footer.php'?>

    Upload the 3 files and this will do the job. Simple!

  5. #5
    What is magic php? - Functions built into PHP?

    I have a recent version of PHP on this server.
    Are you serious?
    ServeYourSite
    Web hosting done right
    ██ Shared, Reseller and Dedicated web hosting
    An Easy Web Presence Company

  6. #6
    Anyway, you can use SSI and a virtual include. Save as .shtml or add the extension you wish to use with the below to using Mime Types

    <!--#include file='filename.htm'-->
    ServeYourSite
    Web hosting done right
    ██ Shared, Reseller and Dedicated web hosting
    An Easy Web Presence Company

  7. #7
    Join Date
    Jul 2003
    Location
    Memphis
    Posts
    30
    how will this effect web spyders as related to keyword indexing?

    Do they analyse PHO content, or is it an issue?

  8. #8
    Join Date
    Jul 2003
    Location
    Memphis
    Posts
    30
    I have been playing with this nifty new *magic*

    And have made a page work - now my question is thing - I see when I look at the source the web page produces, that it is literally combining 2 php pages to return one.

    On the spidering issue - this is obviously server side, so my guess it the spiders dont care one way or another. Is this correct?

    The one thing I am curious about (remember I am mainly ad admin, so save the flames.)

    Is do I need to make sure that what is returned is a valid HTML page? - Because I made the following:

    header.php:
    <strong>
    This is the header <BR>
    </strong>

    Footer.php:
    <strong>
    <BR>This is the footer
    </strong>

    mypage.php:
    <? include('header.php') ?>
    Normal html or php code goes here
    <? include('footer.php') ?>



    And it produces the following:
    <strong>
    This is the header <BR>
    </strong>
    Normal html or php code goes here
    <strong>
    <BR>This is the footer <BR>
    </strong>


    My question is - does it matter that things like </HTML> are not in the page that is generated?

    Thanks for the responses.

  9. #9
    you can make the <html> tags appear...

    <html>
    <head>
    <title>My lovely site</title>
    </head>
    <body>
    <? include('header.php') ?>
    Normal html or php code goes here.
    <? include('header.php') ?>
    </body>
    </html>

    You can use as many times as you want the include() PHP function, as many times and where you want also. You can include .php and also .html or .txt, etc.

    Spiders won't recognize the difference.

  10. #10
    Join Date
    Jul 2003
    Location
    Memphis
    Posts
    30

    makes sense

    I guess that makes sense, because they would ignore those tags anyway eh?

    Also I guess this could be used as some kind of security mechanism? - If you wanted to hide some stuff eh?

  11. #11
    No tags are ignored... HTML will be displayed in the same way as if you wrote all straigt fwrd without include()...

    Test it on your site to see the results.

  12. #12
    Join Date
    Jul 2003
    Location
    Memphis
    Posts
    30

    spiders wouldnt index those tags anyway

    I just meant spiders wouldnt index those tags anyway if they werent there. As long as the page renders correctly.

  13. #13
    Oh... ok, thats true

  14. #14
    Join Date
    Apr 2004
    Location
    Here, most likely not where you are.
    Posts
    12
    Originally posted by pmoduk2
    Are you serious?
    I had the same reaction!!

  15. #15
    My question is - does it matter that things like </HTML> are not in the page that is generated?
    Depends, if you want it to completely fail in search engines, follow no rules as to standard HTML 4.01 and so on, then you can leave them out.

    I suggest coding your whole page, then certain areas that will be the same on every page, copy the page into a new file, and use an include to include that section.

    If your page is made up of tables, make sure you don't miss any tags out. If you want to make an example of explain in full detail just ask and I will
    ServeYourSite
    Web hosting done right
    ██ Shared, Reseller and Dedicated web hosting
    An Easy Web Presence Company

  16. #16
    Just another tips : use Dreamweaver templates to create the whole page. Basically, instead of including the files in php, you hard coded the header and footer in your page and create an editable region for your content. It is easier that including the includes files.

  17. #17
    The great thing about include() is that it will be easier to edit all pages at once.

    I mean:

    If you have an include file just with "Copyright 2004". And next year you change this file to "Copyright 2005" all pages will be updated, and you don't need to change 1 by 1.

    The same with the header or footer.

    You can also include files into files that are included.

Posting Permissions

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