473,799 Members | 2,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
23 3103
in article os************* *************** **@comcast.com, Jerry Stuckle at
js*******@attgl obal.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
"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
^^^^^^^
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*******@attg lobal.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
"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?


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*******@attg lobal.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*******@attgl obal.net
=============== ===
Apr 2 '06 #14
Stephen Kay wrote:
in article os************* *************** **@comcast.com, Jerry Stuckle at
js*******@attgl obal.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
"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,


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*******@attgl obal.net
=============== ===
Apr 2 '06 #15
Stephen Kay wrote:
in article os************* *************** **@comcast.com, Jerry Stuckle at
js*******@attgl obal.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
"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,

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*******@attgl obal.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*******@attgl obal.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************* ***********@new s.readfreenews. net, Geoff Muldoon
at ge***********@t rap.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*******@attgl obal.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
procedural ly 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*******@attgl obal.net
=============== ===
Apr 3 '06 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1482
by: charlie | last post by:
We have an unusual situation at the USC School of Medicine; we have to covert every Web page to a template. The template is too wide to print and a lot of our students print lectures, notes, etc. We thought we could keep to the template and draw in the content from other files by using includes. BUT these files are HTML files and therefore, have Body commands in them. If this could work, we could put a printable link back to the other page...
3
1789
by: Dave | last post by:
Hi Is specifying attributes (basic font size, colour etc) with a "body" tag in a style sheet as good as putting those things in a basic "p" tag for the sheet? If the answer is that using "p" rather than "body" is more reliable, how do you specify the page background colour in css? Is it true that to meet official standards all css sheets should be presented in
12
2998
by: tshad | last post by:
I am not sure why I am getting this error: I have the following code I want to run from another include file that holds all my functions. functions.inc ************************************************************************************ <Script runat="Server"> Sub fnHeader(client As String) response.write("<!-- #include file = ../includes/staffingHeaders.inc -->")
2
1265
by: John Buell | last post by:
When I generate an html email to send via SmtpMail, it will (apparently) randomly remove a period in the filename for some image and anchor tags, but not all For example, in the email body, i may have an image <img border="0" src="http://servername/filename.gif" But it will be received in Outlook as <img border="0" src="http://servername/filenamegif" NOTE THE MISSING PERIOD IN THE FILENAME The same thing can occur for an anchor tag...
5
2086
by: Big Bill | last post by:
http://www.promcars.co.uk/pages/rebecca.php this is not the way it's supposed to be, is it... ok then for me just to remove the body tags from the include files, it'll all work ok? I don't know php and I'm working with a webmaster who, I suspect, doesn't know it too well either. BB --
3
2961
by: Water Cooler v2 | last post by:
Questions: 1. Can there be more than a single script block in a given HEAD tag? 2. Can there be more than a single script block in a given BODY tag? To test, I tried the following code. None of the script gets executed. Can someone please give me a direction as to what I may be missing? Thanks.
2
2070
by: hon123456 | last post by:
Dear all, I want to know the difference and effect of placing ASP Code in the begining of .asp File and placing code inside <Head</ HeadTag and Placing code inside <body></bodytag. Just as follows: 1. Placing code in the Begining of asp file <% Response.write "Hello" %>
4
2487
by: AAaron123 | last post by:
<body runat="server" id="MainBody"> <form id="form1" runat="server" style="background-color:green; width: 100%; height: 100%"> <br /> Table1" runat="server" Style="background-color:Yellow; width: 100%; height: 90%" BorderColor="Maroon"
2
18552
rhitam30111985
by: rhitam30111985 | last post by:
Hi all , I am trying to read an html file and retrieve only the text between the body tags of that file. Now , for reading a string between two strings , i already have a function : http://www.mycsharpcorner.com/Post.aspx?postID=15
0
9689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10495
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10248
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5597
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4148
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2942
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.