Html include

Discussion in 'HTML' started by John, Jul 24, 2007.

  1. John

    John Guest

    Hello,


    I have an html page and want to include and html menu that I use on
    all pages. What is the best way to do this? A php include command?
    John, Jul 24, 2007
    #1
    1. Advertising

  2. John wrote:

    > I have an html page and want to include and html menu that I use on
    > all pages. What is the best way to do this? A php include command?


    That is what I do.

    include "/common/menu.php";

    Mine is a php script because it does processing based on what page(s)
    called it. If yours is a static menu, it can be pure HTML.

    --
    -bts
    -Motorcycles defy gravity; cars just suck
    Beauregard T. Shagnasty, Jul 24, 2007
    #2
    1. Advertising

  3. John

    Paul Furman Guest

    Beauregard T. Shagnasty wrote:

    > John wrote:
    >
    >
    >>I have an html page and want to include and html menu that I use on
    >>all pages. What is the best way to do this? A php include command?

    >
    >
    > That is what I do.
    >
    > include "/common/menu.php";
    >
    > Mine is a php script because it does processing based on what page(s)
    > called it. If yours is a static menu, it can be pure HTML.


    In case John doesn't know...

    <?
    include "/common/menu.php";
    ?>
    Paul Furman, Jul 26, 2007
    #3
  4. John

    Nick Marks Guest

    I think you are getting it wrong... if you want to include it onto a
    HTML page then you will have to do it manually ... Include will not
    work on HTML pages.. Alternatively you can use frames or IFrames

    For more help Email me
    http://www.design2host.net
    Nick Marks, Jul 26, 2007
    #4
  5. John

    Paul Furman Guest

    Nick Marks wrote:

    > I think you are getting it wrong... if you want to include it onto a
    > HTML page then you will have to do it manually ... Include will not
    > work on HTML pages.. Alternatively you can use frames or IFrames


    Hmm, OK you are right!
    A php file will parse html though and can include perhaps any extension
    on a ascii file, so:

    INDEX.PHP:
    <html>
    <head>... blah
    <body>... blah
    <?
    include "menu.txt";
    include "body.txt";
    ?>
    </body>
    </html>

    Probably someone will have another solution.

    --
    Paul Furman Photography
    http://www.edgehill.net/1
    Bay Natives Nursery
    http://www.baynatives.com
    Paul Furman, Jul 26, 2007
    #5
  6. Nick Marks wrote:

    > I think you are getting it wrong...


    You think /who/ are getting it wrong? You must be new here. Normally,
    we quote the relevant part of the post we are replying to, as I am doing
    here. Oh, you don't think this is *Google* do you?

    > if you want to include it onto a HTML page then you will have to do it
    > manually ...


    There's another way?

    > Include will not work on HTML pages.. Alternatively you can use frames
    > or IFrames


    Yes, you /are/ new here. Google for "frames are evil"

    > For more help Email me
    > hxxp://www.design2host.net


    No thanks. Not if that is your best work. <lol>
    <http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.design2host.net%2F>
    <http://jigsaw.w3.org/css-validator/validator?profile=css2&warning=2&uri=http%3A%2F%2Fwww.design2host.net%2F>

    --
    -bts
    -Motorcycles defy gravity; cars just suck
    Beauregard T. Shagnasty, Jul 26, 2007
    #6
  7. John

    Bergamot Guest

    Nick Marks wrote:
    > if you want to include it onto a
    > HTML page then you will have to do it manually ... Include will not
    > work on HTML pages..


    Ever hear of a little thing called SSI?

    > Alternatively you can use frames or IFrames


    Both bad choices.

    > For more help Email me


    The blind leading the blind...?

    --
    Berg
    Bergamot, Jul 26, 2007
    #7
  8. John

    Chaddy2222 Guest

    On Jul 26, 11:12 am, "Beauregard T. Shagnasty"
    <> wrote:
    > Nick Marks wrote:
    > > I think you are getting it wrong...

    >
    > You think /who/ are getting it wrong? You must be new here. Normally,
    > we quote the relevant part of the post we are replying to, as I am doing
    > here. Oh, you don't think this is *Google* do you?
    >
    > > if you want to include it onto a HTML page then you will have to do it
    > > manually ...

    >
    > There's another way?
    >
    > > Include will not work on HTML pages.. Alternatively you can use frames
    > > or IFrames

    >
    > Yes, you /are/ new here. Google for "frames are evil"
    >
    > > For more help Email me
    > > hxxp://www.design2host.net

    >
    > No thanks. Not if that is your best work. <lol>
    > <http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.design2h...>
    > <http://jigsaw.w3.org/css-validator/validator?profile=css2&warning=2&u...>
    >

    Ha, you reckon that's bad, I know of a bloke, well I presume it's a
    bloke who keeps telling us (people who are new-ish to CSS to back to
    HTML 3.2 as he / she / it thiks it (3.2) gives you more control then
    what you get with CSS. But I thaught at the time it was the most
    rediculous thing I had read. Oh and I stil do think that way about
    HTML 3.2, I mean how can people still pay $50 per hour for old code
    that will not work (as well) or at all on modern web browsers.
    --
    Regards Chad. http://freewebdesign.awardspace.biz
    Chaddy2222, Jul 26, 2007
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin

    include HTML code from html page

    Kevin, Sep 27, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    706
    Siva M
    Sep 27, 2005
  2. Cloud Burst
    Replies:
    11
    Views:
    1,027
  3. Danny Anderson
    Replies:
    5
    Views:
    497
    Victor Bazarov
    Aug 15, 2003
  4. Tom
    Replies:
    8
    Views:
    669
    Adrienne Boswell
    Feb 13, 2007
  5. Andreas Bogenberger
    Replies:
    3
    Views:
    906
    Andreas Bogenberger
    Feb 22, 2008
Loading...

Share This Page