body tags in an include?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Big Bill

    body tags in an include?

    The page you’re looking for has been removed as part of an update to our site. It may have been an old listing, an outdated location, or a service we no longer offer.


    I don't believe they should be there, can I take them out without
    stopping the includes from functioning? I'm the (hapless) optimiser on
    this one... I have to correct where they've spelled my name wrong
    too...sigh...

    BB
    --





  • Jerry Stuckle

    #2
    Re: body tags in an include?

    Big Bill wrote:[color=blue]
    > http://www.promcars.co.uk/pages/bonnie.php
    >
    > I don't believe they should be there, can I take them out without
    > stopping the includes from functioning? I'm the (hapless) optimiser on
    > this one... I have to correct where they've spelled my name wrong
    > too...sigh...
    >
    > BB[/color]

    Body tags (or any tags for that matter) have nothing to do with whether an
    include functions or not.

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • fiziwig

      #3
      Re: body tags in an include?

      I'm a php newbie so take it with a grain of salt, but I put my body tag
      in my header.inc file and functions perfectly. All that matters is
      where the body tag ends up in the final generated HTML code.

      --gary

      Comment

      • Jim Carlock

        #4
        Re: body tags in an include?

        "Big Bill" <kruse@cityscap e.co.uk> wrote:[color=blue]
        > http://www.promcars.co.uk/pages/bonnie.php
        > I don't believe they should be there, can I take them out without
        > stopping the includes from functioning? I'm the (hapless) optimiser
        > on this one... I have to correct where they've spelled my name
        > wrong too...sigh...[/color]

        Bill, look at it this way...

        If every page has the same image at the top of the screen, the same
        menu on the left of the screen, and then they have the same opening
        <div class="maincont ent"> tag, the best way to handle this is how?
        Furthermore, if they ALL have the same <link > tag including the
        same CSS file, the same javascript include tags, why not create one
        file and just include it after inserting the

        <title>,
        <meta name="keywords" ...
        <meta name="descripti on" ...

        and they all will contain the same things here, unless you dynamically
        load the left menu, topmenu items, et al. And even then, the included
        file could identify which page gets loaded, and dim out the appropriate
        menu items.

        </head>
        <body><div id="topbanner"> ...</div>
        <div id="leftmenu">. ..</div>
        <div id="maincontent ">

        tags. Furthermore, if each page reads it's keywords and description
        and title from a database, you could configure it all inside one include
        file, and use the page name/folder/or whatever to identify which record
        to load and your whole presentation could come from a database.

        Jim Carlock
        Post replies to the group.


        Comment

        • Big Bill

          #5
          Re: body tags in an include?

          On Sat, 01 Apr 2006 05:14:54 GMT, "Jim Carlock" <anonymous@127. 0.0.1>
          wrote:
          [color=blue]
          >"Big Bill" <kruse@cityscap e.co.uk> wrote:[color=green]
          >> http://www.promcars.co.uk/pages/bonnie.php
          >> I don't believe they should be there, can I take them out without
          >> stopping the includes from functioning? I'm the (hapless) optimiser
          >> on this one... I have to correct where they've spelled my name
          >> wrong too...sigh...[/color]
          >
          >Bill, look at it this way...
          >
          >If every page has the same image at the top of the screen, the same
          >menu on the left of the screen, and then they have the same opening
          ><div class="maincont ent"> tag, the best way to handle this is how?
          >Furthermore, if they ALL have the same <link > tag including the
          >same CSS file, the same javascript include tags, why not create one
          >file and just include it after inserting the
          >
          > <title>,
          > <meta name="keywords" ...
          > <meta name="descripti on" ...
          >
          >and they all will contain the same things here, unless you dynamically
          >load the left menu, topmenu items, et al. And even then, the included
          >file could identify which page gets loaded, and dim out the appropriate
          >menu items.
          >
          > </head>
          > <body><div id="topbanner"> ...</div>
          > <div id="leftmenu">. ..</div>
          > <div id="maincontent ">
          >
          >tags. Furthermore, if each page reads it's keywords and description
          >and title from a database, you could configure it all inside one include
          >file, and use the page name/folder/or whatever to identify which record
          >to load and your whole presentation could come from a database.
          >
          >Jim Carlock
          >Post replies to the group.
          >[/color]

          Perhaps I should have put "Multiple body tags in one page due to php
          includes using them, one pair per include". Is that any clearer?
          That's the problem the page has if you look at it, multiple instances
          of the body tag. I don't believe they should be there as obviously an
          include shouldn't need to be topped and tailed with a body tag if it's
          one of several includes in an existing page with its own body tags
          anyway.

          BB
          --





          Comment

          • Jim Carlock

            #6
            Re: body tags in an include?

            "Big Bill" <kruse@cityscap e.co.uk> wrote:[color=blue]
            > Perhaps I should have put "Multiple body tags in one page
            > due to php includes using them, one pair per include". Is that
            > any clearer?[/color]

            There's only supposed to be one <head> section and only one
            <body> section in any document. Including more than one of
            either/or (1) throws a browser into quirks mode, (2) creates an
            invalid document, (3) makes debugging harder, (4) adds more
            unnecessary content to the page, making the page bigger, which
            in turn slows down the delivery of the page and (5) it serves no
            purpose.

            I see no reason for placing multiple <body> tags in any HTML
            document.

            Hope that helps.

            Jim Carlock
            Post replies to the group.


            Comment

            • Jerry Stuckle

              #7
              Re: body tags in an include?

              Big Bill wrote:[color=blue]
              > On Sat, 01 Apr 2006 05:14:54 GMT, "Jim Carlock" <anonymous@127. 0.0.1>
              > wrote:
              >
              >[color=green]
              >>"Big Bill" <kruse@cityscap e.co.uk> wrote:
              >>[color=darkred]
              >>>http://www.promcars.co.uk/pages/bonnie.php
              >>>I don't believe they should be there, can I take them out without
              >>>stopping the includes from functioning? I'm the (hapless) optimiser
              >>>on this one... I have to correct where they've spelled my name
              >>>wrong too...sigh...[/color]
              >>
              >>Bill, look at it this way...
              >>
              >>If every page has the same image at the top of the screen, the same
              >>menu on the left of the screen, and then they have the same opening
              >><div class="maincont ent"> tag, the best way to handle this is how?
              >>Furthermore , if they ALL have the same <link > tag including the
              >>same CSS file, the same javascript include tags, why not create one
              >>file and just include it after inserting the
              >>
              >><title>,
              >><meta name="keywords" ...
              >><meta name="descripti on" ...
              >>
              >>and they all will contain the same things here, unless you dynamically
              >>load the left menu, topmenu items, et al. And even then, the included
              >>file could identify which page gets loaded, and dim out the appropriate
              >>menu items.
              >>
              >></head>
              >><body><div id="topbanner"> ...</div>
              >><div id="leftmenu">. ..</div>
              >><div id="maincontent ">
              >>
              >>tags. Furthermore, if each page reads it's keywords and description
              >>and title from a database, you could configure it all inside one include
              >>file, and use the page name/folder/or whatever to identify which record
              >>to load and your whole presentation could come from a database.
              >>
              >>Jim Carlock
              >>Post replies to the group.
              >>[/color]
              >
              >
              > Perhaps I should have put "Multiple body tags in one page due to php
              > includes using them, one pair per include". Is that any clearer?
              > That's the problem the page has if you look at it, multiple instances
              > of the body tag. I don't believe they should be there as obviously an
              > include shouldn't need to be topped and tailed with a body tag if it's
              > one of several includes in an existing page with its own body tags
              > anyway.
              >
              > BB[/color]

              Bill,

              No, multiple <head> and <body> tags in a document are invalid.

              include() effectively just does a "copy and paste" of the new file into the
              existing one. So if both files have <body> tags then you end up with two <body>
              tags, as you found.

              And it's time to fire the idiots who places these tags in included files!

              --
              =============== ===
              Remove the "x" from my email address
              Jerry Stuckle
              JDS Computer Training Corp.
              jstucklex@attgl obal.net
              =============== ===

              Comment

              • Big Bill

                #8
                Re: body tags in an include?

                On Sat, 01 Apr 2006 08:31:49 GMT, "Jim Carlock" <anonymous@127. 0.0.1>
                wrote:
                [color=blue]
                >"Big Bill" <kruse@cityscap e.co.uk> wrote:[color=green]
                >> Perhaps I should have put "Multiple body tags in one page
                >> due to php includes using them, one pair per include". Is that
                >> any clearer?[/color]
                >
                >There's only supposed to be one <head> section and only one
                ><body> section in any document. Including more than one of
                >either/or (1) throws a browser into quirks mode, (2) creates an
                >invalid document, (3) makes debugging harder, (4) adds more
                >unnecessary content to the page, making the page bigger, which
                >in turn slows down the delivery of the page and (5) it serves no
                >purpose.
                >
                >I see no reason for placing multiple <body> tags in any HTML
                >document.[/color]

                Me neither. I have to educate the webmaster, it seems.

                BB
                --





                Comment

                • Big Bill

                  #9
                  Re: body tags in an include?

                  On Sat, 01 Apr 2006 08:45:38 -0500, Jerry Stuckle
                  <jstucklex@attg lobal.net> wrote:
                  [color=blue][color=green]
                  >> Perhaps I should have put "Multiple body tags in one page due to php
                  >> includes using them, one pair per include". Is that any clearer?
                  >> That's the problem the page has if you look at it, multiple instances
                  >> of the body tag. I don't believe they should be there as obviously an
                  >> include shouldn't need to be topped and tailed with a body tag if it's
                  >> one of several includes in an existing page with its own body tags
                  >> anyway.
                  >>
                  >> BB[/color]
                  >
                  >Bill,
                  >
                  >No, multiple <head> and <body> tags in a document are invalid.
                  >
                  >include() effectively just does a "copy and paste" of the new file into the
                  >existing one. So if both files have <body> tags then you end up with two <body>
                  >tags, as you found.
                  >
                  >And it's time to fire the idiots who places these tags in included files![/color]

                  Ah, little problem there, you see, it was he who suggested that I be
                  hired for the optimisation... he has done some stuff in the past I've
                  worked on that has had great visual appeal but he does need to be
                  pulled up on a few things.

                  BB
                  --





                  Comment

                  • David

                    #10
                    Re: body tags in an include?

                    [color=blue]
                    >
                    > Me neither. I have to educate the webmaster, it seems.
                    >[/color]

                    I would be questing him as a web master if he is using multipal <body>
                    tags within his documents. Actually I would be running in the opposite
                    direction from him.

                    Comment

                    • Stephen Kay

                      #11
                      Re: body tags in an include? Related question

                      in article os6dnf-A8tscGbPZnZ2dnU VZ_vudnZ2d@comc ast.com, Jerry Stuckle at
                      jstucklex@attgl obal.net wrote on 4/1/06 8:45 AM:
                      [color=blue]
                      > No, multiple <head> and <body> tags in a document are invalid.
                      >
                      > include() effectively just does a "copy and paste" of the new file into the
                      > existing one. So if both files have <body> tags then you end up with two
                      > <body>
                      > tags, as you found.
                      >
                      > And it's time to fire the idiots who places these tags in included files![/color]


                      Related to this question, I am changing a previously "all HTML" site into a
                      "dynamicall y displayed by php" site. So I now have a template file with a
                      header, footer, navbar, etc., and when you call one of the old pages, Apache
                      redirects it into a dopage.php?p=pa ge.html format, and the old page is read
                      in to a $content variable, and displayed inside the template. Pretty
                      straightforward .

                      However, since all of the old pages (and there's a lot of them) were HTML
                      standalones, they all have headers, html tags, and body tags.

                      At the moment, it seems to be working fine, even with the extra html,
                      header, and body tags displayed in the middle of the page, nested inside the
                      "real" html and body tags.

                      I assume this is a no-no, but what are the problems with just leaving it
                      this way? It seems to be working anyway. Otherwise, I assume the options are
                      to rewrite every single page to remove this stuff, or to try and remove it
                      procedurally after reading it into the $content variable.

                      Thanks,
                      --
                      Stephen Kay
                      Karma-Lab sk@karma-lab.NOSPAM.com
                      ^^^^^^^


                      Comment

                      • Big Bill

                        #12
                        Re: body tags in an include? Related question

                        On Sat, 01 Apr 2006 22:42:50 GMT, Stephen Kay
                        <sk@karma-lab.nospam.com> wrote:
                        [color=blue]
                        >in article os6dnf-A8tscGbPZnZ2dnU VZ_vudnZ2d@comc ast.com, Jerry Stuckle at
                        >jstucklex@attg lobal.net wrote on 4/1/06 8:45 AM:
                        >[color=green]
                        >> No, multiple <head> and <body> tags in a document are invalid.
                        >>
                        >> include() effectively just does a "copy and paste" of the new file into the
                        >> existing one. So if both files have <body> tags then you end up with two
                        >> <body>
                        >> tags, as you found.
                        >>
                        >> And it's time to fire the idiots who places these tags in included files![/color]
                        >
                        >
                        >Related to this question, I am changing a previously "all HTML" site into a
                        >"dynamicall y displayed by php" site. So I now have a template file with a
                        >header, footer, navbar, etc., and when you call one of the old pages, Apache
                        >redirects it into a dopage.php?p=pa ge.html format, and the old page is read
                        >in to a $content variable, and displayed inside the template. Pretty
                        >straightforwar d.
                        >
                        >However, since all of the old pages (and there's a lot of them) were HTML
                        >standalones, they all have headers, html tags, and body tags.
                        >
                        >At the moment, it seems to be working fine, even with the extra html,
                        >header, and body tags displayed in the middle of the page, nested inside the
                        >"real" html and body tags.
                        >
                        >I assume this is a no-no, but what are the problems with just leaving it
                        >this way?[/color]

                        Semantically it'll be a mess and the search engines may well have
                        trouble determining the nature of the content. That's the SEO point of
                        view. It's why I'm trying to get rid of the anomalies in the ones I've
                        been handed.
                        [color=blue]
                        > It seems to be working anyway.[/color]

                        It displays ok, yeah, so do mine.
                        [color=blue]
                        > Otherwise, I assume the options are
                        >to rewrite every single page to remove this stuff,[/color]

                        You don't want to remove the info that's in some of the tags, you need
                        to keep the individual title tags and description tags, they're there
                        for a reason.
                        [color=blue]
                        > or to try and remove it
                        >procedurally after reading it into the $content variable.[/color]

                        Going from my brief intro to php, I dunno! I have a long enough night
                        ahead of me as it is!

                        BB



                        --





                        Comment

                        • Jim Carlock

                          #13
                          Re: body tags in an include? Related question

                          "Big Bill" wanted to know about multiple <body> and <head> tags.

                          I can see someone sticking multiple <body> and <head> tags in
                          when they're working with inline frames, framed content, but the
                          proper way to do this (I believe) would be detect if the page is
                          read from another page (has a parent) (server side script?).

                          I'm not familiar enough with PHP to give an answer, so perhaps
                          someone here could suggest the best way to detect if a framed
                          page is loaded from the address bar or as a frame. I'd like to get
                          a grip on this, myself.

                          Thanks much for any help here.

                          Jim Carlock
                          Post replies to the group.


                          Comment

                          • Jerry Stuckle

                            #14
                            Re: body tags in an include?

                            Big Bill wrote:[color=blue]
                            > On Sat, 01 Apr 2006 08:45:38 -0500, Jerry Stuckle
                            > <jstucklex@attg lobal.net> wrote:
                            >
                            >[color=green][color=darkred]
                            >>>Perhaps I should have put "Multiple body tags in one page due to php
                            >>>includes using them, one pair per include". Is that any clearer?
                            >>>That's the problem the page has if you look at it, multiple instances
                            >>>of the body tag. I don't believe they should be there as obviously an
                            >>>include shouldn't need to be topped and tailed with a body tag if it's
                            >>>one of several includes in an existing page with its own body tags
                            >>>anyway.
                            >>>
                            >>>BB[/color]
                            >>
                            >>Bill,
                            >>
                            >>No, multiple <head> and <body> tags in a document are invalid.
                            >>
                            >>include() effectively just does a "copy and paste" of the new file into the
                            >>existing one. So if both files have <body> tags then you end up with two <body>
                            >>tags, as you found.
                            >>
                            >>And it's time to fire the idiots who places these tags in included files![/color]
                            >
                            >
                            > Ah, little problem there, you see, it was he who suggested that I be
                            > hired for the optimisation... he has done some stuff in the past I've
                            > worked on that has had great visual appeal but he does need to be
                            > pulled up on a few things.
                            >
                            > BB[/color]


                            Hmmm, I understand - but that kind of recommendation I think I can do without!

                            --
                            =============== ===
                            Remove the "x" from my email address
                            Jerry Stuckle
                            JDS Computer Training Corp.
                            jstucklex@attgl obal.net
                            =============== ===

                            Comment

                            • Jerry Stuckle

                              #15
                              Re: body tags in an include? Related question

                              Stephen Kay wrote:[color=blue]
                              > in article os6dnf-A8tscGbPZnZ2dnU VZ_vudnZ2d@comc ast.com, Jerry Stuckle at
                              > jstucklex@attgl obal.net wrote on 4/1/06 8:45 AM:
                              >
                              >[color=green]
                              >>No, multiple <head> and <body> tags in a document are invalid.
                              >>
                              >>include() effectively just does a "copy and paste" of the new file into the
                              >>existing one. So if both files have <body> tags then you end up with two
                              >><body>
                              >>tags, as you found.
                              >>
                              >>And it's time to fire the idiots who places these tags in included files![/color]
                              >
                              >
                              >
                              > Related to this question, I am changing a previously "all HTML" site into a
                              > "dynamicall y displayed by php" site. So I now have a template file with a
                              > header, footer, navbar, etc., and when you call one of the old pages, Apache
                              > redirects it into a dopage.php?p=pa ge.html format, and the old page is read
                              > in to a $content variable, and displayed inside the template. Pretty
                              > straightforward .
                              >
                              > However, since all of the old pages (and there's a lot of them) were HTML
                              > standalones, they all have headers, html tags, and body tags.
                              >
                              > At the moment, it seems to be working fine, even with the extra html,
                              > header, and body tags displayed in the middle of the page, nested inside the
                              > "real" html and body tags.
                              >
                              > I assume this is a no-no, but what are the problems with just leaving it
                              > this way? It seems to be working anyway. Otherwise, I assume the options are
                              > to rewrite every single page to remove this stuff, or to try and remove it
                              > procedurally after reading it into the $content variable.
                              >
                              > Thanks,[/color]

                              Other than:

                              1. It may or may not work in all current browsers,
                              2. It may or may not work in next generation browsers,
                              3. One look at the source (in any browser) shows you are lousy webmaster.

                              Any questions?

                              And btw - I would never code something like this in the first pace. Virtually
                              impossible to maintain!


                              --
                              =============== ===
                              Remove the "x" from my email address
                              Jerry Stuckle
                              JDS Computer Training Corp.
                              jstucklex@attgl obal.net
                              =============== ===

                              Comment

                              Working...