468,136 Members | 1,441 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,136 developers. It's quick & easy.

body tags in an include?

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
--

http://www.kruse.co.uk/seo-articles.htm
http://www.here-be-posters.co.uk/mot...rs-sitemap.htm
http://www.crystal-liaison.com/crystal-world/index.html

Apr 1 '06 #1
23 2664
Big Bill wrote:
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


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.
js*******@attglobal.net
==================
Apr 1 '06 #2
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

Apr 1 '06 #3
"Big Bill" <kr***@cityscape.co.uk> wrote:
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...


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="maincontent"> 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="description" ...

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.
Apr 1 '06 #4
On Sat, 01 Apr 2006 05:14:54 GMT, "Jim Carlock" <an*******@127.0.0.1>
wrote:
"Big Bill" <kr***@cityscape.co.uk> wrote:
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...


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="maincontent"> 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="description" ...

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.


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
--

http://www.kruse.co.uk/seo-articles.htm
http://www.here-be-posters.co.uk/mot...rs-sitemap.htm
http://www.crystal-liaison.com/crystal-world/index.html

Apr 1 '06 #5
"Big Bill" <kr***@cityscape.co.uk> wrote:
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?


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.
Apr 1 '06 #6
Big Bill wrote:
On Sat, 01 Apr 2006 05:14:54 GMT, "Jim Carlock" <an*******@127.0.0.1>
wrote:

"Big Bill" <kr***@cityscape.co.uk> wrote:
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...


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="maincontent"> 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="description" ...

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.

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


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.
js*******@attglobal.net
==================
Apr 1 '06 #7
On Sat, 01 Apr 2006 08:31:49 GMT, "Jim Carlock" <an*******@127.0.0.1>
wrote:
"Big Bill" <kr***@cityscape.co.uk> wrote:
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?


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.


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

BB
--

http://www.kruse.co.uk/seo-articles.htm
http://www.here-be-posters.co.uk/mot...rs-sitemap.htm
http://www.crystal-liaison.com/crystal-world/index.html

Apr 1 '06 #8
On Sat, 01 Apr 2006 08:45:38 -0500, Jerry Stuckle
<js*******@attglobal.net> wrote:
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


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!


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
--

http://www.kruse.co.uk/seo-articles.htm
http://www.here-be-posters.co.uk/mot...rs-sitemap.htm
http://www.crystal-liaison.com/crystal-world/index.html

Apr 1 '06 #9

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


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.

Apr 1 '06 #10
in article os******************************@comcast.com, Jerry Stuckle at
js*******@attglobal.net wrote on 4/1/06 8:45 AM:
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!

Related to this question, I am changing a previously "all HTML" site into a
"dynamically 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=page.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
^^^^^^^
Apr 1 '06 #11
On Sat, 01 Apr 2006 22:42:50 GMT, Stephen Kay
<sk@karma-lab.nospam.com> wrote:
in article os******************************@comcast.com, Jerry Stuckle at
js*******@attglobal.net wrote on 4/1/06 8:45 AM:
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!

Related to this question, I am changing a previously "all HTML" site into a
"dynamically 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=page.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?


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.
It seems to be working anyway.
It displays ok, yeah, so do mine.
Otherwise, I assume the options are
to rewrite every single page to remove this stuff,
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.
or to try and remove it
procedurally after reading it into the $content variable.


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

BB

--

http://www.kruse.co.uk/seo-articles.htm
http://www.here-be-posters.co.uk/mot...rs-sitemap.htm
http://www.crystal-liaison.com/crystal-world/index.html

Apr 1 '06 #12
"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.
Apr 2 '06 #13
Big Bill wrote:
On Sat, 01 Apr 2006 08:45:38 -0500, Jerry Stuckle
<js*******@attglobal.net> wrote:

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


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!

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

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.
js*******@attglobal.net
==================
Apr 2 '06 #14
Stephen Kay wrote:
in article os******************************@comcast.com, Jerry Stuckle at
js*******@attglobal.net wrote on 4/1/06 8:45 AM:

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!


Related to this question, I am changing a previously "all HTML" site into a
"dynamically 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=page.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,


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.
js*******@attglobal.net
==================
Apr 2 '06 #15
Stephen Kay wrote:
in article os******************************@comcast.com, Jerry Stuckle at
js*******@attglobal.net wrote on 4/1/06 8:45 AM:

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!


Related to this question, I am changing a previously "all HTML" site into a
"dynamically 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=page.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,

You could alway strip the code of each page, so that all that is used
from an include is the stuff between the body tags.... at least it would
then be compliant.
Apr 2 '06 #16
in article X-******************************@comcast.com, Jerry Stuckle at
js*******@attglobal.net wrote on 4/1/06 10:37 PM:
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,
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?

Well, #1 & #2 make sense. #3 I guess might be important for those people
who have their self-worth tied up in things like that. I mean, that's the
first thing I do when I go to a site: look at the source and evaluated the
skill of the programmers. ;-)

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


Which part are you talking about? Having a php template with a header, a
navbar, and a footer, and then being able to include content somewhere in
the page?

Or reading pre-existing HTML pages for the content part?

I wouldn't structure it like this either, except the site already exists,
has probably a hundred existing pages, and used to use a godawful frame set
arrangement. I'm trying to improve it without rewriting the whole thing or
cleaning up every single page. But maybe that's the way to go, anyway.

--
Stephen Kay
Karma-Lab sk@karma-lab.NOSPAM.com
^^^^^^^
Apr 3 '06 #17
js*******@attglobal.net says...
Stephen Kay wrote:

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,


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.


4. A lot of search engine spiders will reject your pages.

Geoff M
Apr 3 '06 #18
in article MP************************@news.readfreenews.net, Geoff Muldoon
at ge***********@trap.gmail.com wrote on 4/2/06 9:28 PM:
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.


4. A lot of search engine spiders will reject your pages.

OK, OK - you've all convinced me.

So If I want to read a full HTML page into a $content variable, and then
split off the header, remove the HTML and BODY tages parts of the page, and
replace the header in enclosing parent template with some of that header's
information, any code examples laying around?

Thanks mucho,
--
Stephen Kay
Karma-Lab sk@karma-lab.NOSPAM.com
^^^^^^^
Apr 3 '06 #19
Stephen Kay wrote:
in article X-******************************@comcast.com, Jerry Stuckle at
js*******@attglobal.net wrote on 4/1/06 10:37 PM:

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,
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?


Well, #1 & #2 make sense. #3 I guess might be important for those people
who have their self-worth tied up in things like that. I mean, that's the
first thing I do when I go to a site: look at the source and evaluated the
skill of the programmers. ;-)


#3 might also be important if you want more customers. Knowledgeable customers
look at things like that. Or they ask for recommendations from more
knowledgeable people.

So yes, knowledgeable people do look at the source code when looking for
webmasters.

Additionally, techies look at the source to see how a company shows itself to
the outside world. And I would never shop at a company whose so far off the
mark. If they're cutting corners in their marketing, what are they doing on
things I can't see?

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

Which part are you talking about? Having a php template with a header, a
navbar, and a footer, and then being able to include content somewhere in
the page?

Or reading pre-existing HTML pages for the content part?


Treating pre-existing HTML pages for the content part. I have headers, navbars
and footers as include files. But they don't change - and are included in each
page. Content changes, so I have different pages for each.
I wouldn't structure it like this either, except the site already exists,
has probably a hundred existing pages, and used to use a godawful frame set
arrangement. I'm trying to improve it without rewriting the whole thing or
cleaning up every single page. But maybe that's the way to go, anyway.


I still wouldn't structure it like this. And I wouldn't use frames.

They way you're doing it you'll have to rewrite every page anyway to get rid of
the extra tags.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 3 '06 #20
in article C0***************@karma-lab.nospam.com, Stephen Kay at
sk@karma-lab.nospam.com wrote on 4/3/06 12:55 AM:
4. A lot of search engine spiders will reject your pages.


BTW, are there any good references on how search engine spiders work?

Thanks.
--
Stephen Kay
Karma-Lab sk@karma-lab.NOSPAM.com
^^^^^^^
Apr 3 '06 #21
Stephen Kay wrote:
in article C0***************@karma-lab.nospam.com, Stephen Kay at
sk@karma-lab.nospam.com wrote on 4/3/06 12:55 AM:

4. A lot of search engine spiders will reject your pages.

BTW, are there any good references on how search engine spiders work?

Thanks.


They work by crawling the pages in your site. Any more than that is a closely
guarded trade secret of each of the search engines - and changed often (at least
in Google's case). They don't want people to be able to gimmick the pages to
get a higher placement.

There are a lot of guesses around as to how it works. Some are even a bit
educated. But no real facts.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 3 '06 #22
sk@karma-lab.nospam.com says...
BTW, are there any good references on how search engine spiders work?


http://computer.howstuffworks.com/search-engine1.htm

GM
Apr 3 '06 #23
in article MP************************@news.readfreenews.net, Geoff Muldoon
at ge***********@trap.gmail.com wrote on 4/3/06 7:32 PM:
sk@karma-lab.nospam.com says...
BTW, are there any good references on how search engine spiders work?


http://computer.howstuffworks.com/search-engine1.htm


Thank you very much - that was helpful.

--
Stephen Kay
Karma-Lab sk@karma-lab.NOSPAM.com
^^^^^^^
Apr 3 '06 #24

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by charlie | last post: by
3 posts views Thread by Dave | last post: by
12 posts views Thread by tshad | last post: by
2 posts views Thread by hon123456 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.