Alerts
New Jobs on Teachers.Net

The Equity Project Cha...
New York


The Equity Project Cha...
New York



Montgomery Child Care...
Bethesda

Springdale Job Corps C...
Anywhere

Tech

Re: Creating menus ... Thanks and a question
megan

    On 2/12/06, KarenVA wrote:
    > What is a php include? Hi Karen

    "include" is just a shorthand nickname for a file you want to bring
    in and "include" in another file. In your case you want to only
    have to update your menu one time and have the updated version
    display on all pages in your website. So in php you might make a
    file, possibly called inc_menu.php or menu.html or some such. In
    that file would be all your code for your menu then in your site
    pages such as index.php, resources.php, aboutus.php you
    would "include" the file using a bit of code like this
    include('inc_menu.php') or require('path/to/menu.html') - the
    difference in your menu file having a .php extension or a .html is
    that if the extension is .html then the code in the menu file would
    be sent directly to the browser as usual, but if the extension
    is .php then it would be sent to the server for processing of any
    php code first before it goes to the browser.

    Anyway, after the page is rendered, if you view source you will see
    your menu code in with the rest of the code as if it were all one
    file.

    hth, megan