473,383 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

xhtml or html?

I would like to know what HTML standard will be better for PHP
webapplications? Right now, I use HTML 4.01 Transitional. And like to
know what *you* PHP programmers prefer? and which is good? TIA.

--
/\
/ \\ <http://www.homeless-international.org>
/ [] \\\ Email: rrjanbiah-at-Y!com
Jul 17 '05 #1
19 2130
R. Rajesh Jeba Anbiah wrote:
I would like to know what HTML standard will be better for PHP
webapplications? Right now, I use HTML 4.01 Transitional. And like to
know what *you* PHP programmers prefer? and which is good? TIA.


Well it doesn't really matter what version of HTML you use (XHTML is
still HTML just newer) they are two different things, PHP is handled
server side, (X)HTML handled client side, providing you output it
correctly either will work, I however use XHTML as I prefer it.

~Cameron
Jul 17 '05 #2
On 23 Feb 2004 21:35:16 -0800, ng**********@rediffmail.com (R. Rajesh
Jeba Anbiah) wrote:
I would like to know what HTML standard will be better for PHP
webapplications? Right now, I use HTML 4.01 Transitional. And like to
know what *you* PHP programmers prefer? and which is good? TIA.


As far as PHP itself is concerned, it makes no difference whatever.

More generally, search the archive of
comp.infosystems.www.authoring.html for extensive discussions on the
HTML versus XHTML issue. Brief summary: XHTML might have been a good
idea, but the current state of play is that it has no real advantages
over HTML (unless you are already using XML tools for something else)
and certain problems related to e.g. MIME types and IE misbehaviour.

The general recommendation is to use HTML 4.01 Strict for new pages. And
keep your CSS in an external stylesheet - don't generate inline CSS with
PHP.

--
Stephen Poley
Jul 17 '05 #3
I noticed that Message-ID: <4l********************************@4ax.com>
from Stephen Poley contained the following:
The general recommendation is to use HTML 4.01 Strict for new pages.


Though I haven't even seen anyone come up with convincing arguments for
using strict over transitional.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #4
<snip>
Though I haven't even seen anyone come up with convincing arguments for
using strict over transitional.


I am not sure if it can be counted as argument or any good reason, but
depending doctype, browser might end up different "rendering mode"

http://gutfeldt.ch/matthias/articles...tch/table.html

(see difference between strict html 4.01, transitional 4.01 and transitional
4.01 with "loose" doctype rendiering modes for browsers)...

http://gutfeldt.ch/matthias/articles/doctypeswitch.html might also tell
something more
Jul 17 '05 #5
Cameron <fo*@bar.invalid> wrote in message news:<c1**********@newsg3.svr.pol.co.uk>...
R. Rajesh Jeba Anbiah wrote:
I would like to know what HTML standard will be better for PHP
webapplications? Right now, I use HTML 4.01 Transitional. And like to
know what *you* PHP programmers prefer? and which is good? TIA.


Well it doesn't really matter what version of HTML you use (XHTML is
still HTML just newer) they are two different things, PHP is handled
server side, (X)HTML handled client side, providing you output it
correctly either will work, I however use XHTML as I prefer it.


Thanks for your reply. IIRC, since PHP 4, they've added something
like XHTML compliant especially in nl2br(), highlight_file(),... But,
I hardly seen such XHTMLed PHP scripts. May I know the reason behind
your preference?

--
"Success is not what you achieve, but it is what you die for"
If you live in USA, please support John Edwards.
Email: rrjanbiah-at-Y!com
Jul 17 '05 #6
I noticed that Message-ID: <c1**********@phys-news1.kolumbus.fi> from
Wÿrm contained the following:
<snip>
Though I haven't even seen anyone come up with convincing arguments for
using strict over transitional.


I am not sure if it can be counted as argument or any good reason, but
depending doctype, browser might end up different "rendering mode"

http://gutfeldt.ch/matthias/articles...tch/table.html

(see difference between strict html 4.01, transitional 4.01 and transitional
4.01 with "loose" doctype rendiering modes for browsers)...


Indeed, but all this does is show that if I use <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
my pages will be rendered in a standard way. It doesn't say anything
about the advantages of strict, AFAICS.

I'm a little cynical about this as you can tell. I think some coders
tend to self-flagellate. Emotive words like 'strict' versus
'transitional' and 'loose' encourage this and tend to create impressions
which do not hold up to scrutiny.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #7
<snip>
Indeed, but all this does is show that if I use <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
my pages will be rendered in a standard way. It doesn't say anything
about the advantages of strict, AFAICS.
Yes, strict and transitional 4.01 with
"http://www.w3.org/TR/html4/loose.dtd" should render to same way so no
advantages there between those. :) only difference would be without that
"...loose.dtd" and then different mode might be in.

I'm a little cynical about this as you can tell. I think some coders
tend to self-flagellate. Emotive words like 'strict' versus
'transitional' and 'loose' encourage this and tend to create impressions
which do not hold up to scrutiny.


heh, I know how it can be :) I haven't been that much using strict 4.01,
only in last half year or something after started to do some CSS stuff. Now
I just try stick doing things one way as long as they work for me. And I
guess bottom line always is that as long as it does work for YOU, do it in
your way :)

Jul 17 '05 #8
R. Rajesh Jeba Anbiah wrote:

I would like to know what HTML standard will be better
for PHP webapplications?


Everything I have done in the last couple of years is XHTML 1.0. Clean,
valid, and forward-compatible.

bblackmoor
2004-02-24
Jul 17 '05 #9
On Tue, 24 Feb 2004 12:46:23 +0000, Geoff Berrow <bl******@ckdog.co.uk>
wrote:
I noticed that Message-ID: <4l********************************@4ax.com>
from Stephen Poley contained the following:
The general recommendation is to use HTML 4.01 Strict for new pages.
Though I haven't even seen anyone come up with convincing arguments for
using strict over transitional.


Are you saying that you can't see the advantage of replacing hundreds of
HTML FONT elements with a single CSS rule? Or that no-one explained to
you that this (somewhat simplified) is the advantage?

--
Stephen Poley
Jul 17 '05 #10
Geoff Berrow wrote:
I noticed that Message-ID: <4l********************************@4ax.com>
from Stephen Poley contained the following:
The general recommendation is to use HTML 4.01 Strict for new pages.

Yup, I've noticed that.
Though I haven't even seen anyone come up with convincing arguments for
using strict over transitional.


I couldn't find any.

The purpose of the Strict variation is, I believe, to aid in the
filtration of outdated constructs from HTML. Strict is just a subset
of the more common Transitional variation. That's all.

I reckon puritanical authors believe that by conforming to this more
restrictive subset of the "language" (better: "notation"), they're
tip-toeing one step closer to ML enlightenment and sneakily
advertising their knowledge and ability in the hope that someone
somewhere will pick up on it. Maybe I'm daydreaming. :-)

Unlike the Transitional DTD, the Strict DTD prohibits deprecated
markup; the term "deprecated" is defined in HTML:

http://www.w3.org/TR/html4/conform.html#deprecated

Using Strict instead of Transitional HTML isn't the all-important
factor. Authors ought to understand the reasons why presentational
markup is deprecated and attracts disapproval, and why it's of less
value than logical, descriptive, structural markup; knowing why and
how to *sensibly* avoid procedural notations is the important part.
Armed with that basic ken, one can author logical markup; without it,
markup is destined to contain a thorough sprinkling of
"illogicalities", be it Transitional *or* Strict. Education is the
all-important factor.

http://www.webreference.com/dlab/books/html/3-1.html

Consider for a moment this idiotic scrap of slipshod markup, which,
as it happens, validates as Strict HTML4.01:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<title>intro</title>
<p><strong style="font-size:20pt">my intro</strong>
<div>this page is about rope jumping... i'm so completely clueless
i failed to mention that in the title of my page but im waaaay to
mega k3wl to bother my ass!!1</div>
<h1>Hahahahaha!!!!11</h1>
<div>now lets start......<a href="foo bar">baz</a> omg aint i the
king of jabberwocky?/???!!1!1!</div>

On the other hand, cases exist where deprecated FONT markup would
come in useful. For validation, then, you'd have to either create a
custom DTD or switch to Transitional. Education is the key.

Since we're discussing strictness, would it be better to keep shtum
about *the* (only) HTML standard: ISO/IEC 15445? ;-)

The whys behind downgrading from HTML4.01 to XHTML1.0, however, are
mostly incomprehensible: maybe it's the phase of the moon; possibly
it's the side of the bed the author crawled out from; or, perhaps
almost invariably, it's the perceived necessity to subscribe to that
oh-so-idolatrous fad du jour. I dunno.

Hmm. We're drifting dreadfully off-topic, aren't we?

--
Jock
Jul 17 '05 #11
I noticed that Message-ID: <02********************************@4ax.com>
from Stephen Poley contained the following:
Though I haven't even seen anyone come up with convincing arguments for
using strict over transitional.


Are you saying that you can't see the advantage of replacing hundreds of
HTML FONT elements with a single CSS rule? Or that no-one explained to
you that this (somewhat simplified) is the advantage?

If that was all it was I'd go to strict tomorrow, since I can't remember
that last time I used a <font> tag.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #12
On Tue, 24 Feb 2004 22:22:08 +0100, Stephen Poley
<sb******************@xs4all.nl> wrote:
On Tue, 24 Feb 2004 12:46:23 +0000, Geoff Berrow <bl******@ckdog.co.uk>
wrote:
I noticed that Message-ID: <4l********************************@4ax.com>
from Stephen Poley contained the following:
The general recommendation is to use HTML 4.01 Strict for new pages.

Though I haven't even seen anyone come up with convincing arguments for
using strict over transitional.


Are you saying that you can't see the advantage of replacing hundreds of
HTML FONT elements with a single CSS rule? Or that no-one explained to
you that this (somewhat simplified) is the advantage?


That's an argument for using CSS appropriately; not going to argue with that,
I fully agree with widespread use of CSS. Once you have the same style applied
more than once in a page, and particularly across pages, it's a CSS class, no
arguing.

But HTML Strict does rule out quite a lot of stuff - is it really
cost-efficient to have a CSS class for a one-off bit of highlighting? Geoff's
'self-flagellation' point seems about right here - what's the real advantage,
other than the warm fuzzy feeling of adhering to stricter standards?

With XHTML Strict at least you could argue that then your data is XML-parsable
without having to think about presentation - but you're still effectively
wrapping it in HTML, so surely you'd have an XML source underneath, and apply
XSLT to turn it into XHTML?

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>
Jul 17 '05 #13
On Tue, 24 Feb 2004 22:13:43 +0000, Andy Hassall <an**@andyh.co.uk>
wrote:
On Tue, 24 Feb 2004 22:22:08 +0100, Stephen Poley
<sb******************@xs4all.nl> wrote:
On Tue, 24 Feb 2004 12:46:23 +0000, Geoff Berrow <bl******@ckdog.co.uk>
wrote:
I noticed that Message-ID: <4l********************************@4ax.com>
from Stephen Poley contained the following:

The general recommendation is to use HTML 4.01 Strict for new pages.
Though I haven't even seen anyone come up with convincing arguments for
using strict over transitional.
Are you saying that you can't see the advantage of replacing hundreds of
HTML FONT elements with a single CSS rule? Or that no-one explained to
you that this (somewhat simplified) is the advantage?

That's an argument for using CSS appropriately; not going to argue with that,
I fully agree with widespread use of CSS. Once you have the same style applied
more than once in a page, and particularly across pages, it's a CSS class, no
arguing.

But HTML Strict does rule out quite a lot of stuff - is it really
cost-efficient to have a CSS class for a one-off bit of highlighting?
??. Strict doesn't stop you from using inline styles if you want that.

I know just one thing that Strict rules out that is *occasionally*
wanted, and that is being able to open new windows with the target
attribute. But in approximately 95% of cases where websites open a new
window there is no good reason to do so. The reader can always open a
link in a new window anyway if he/she wants that.

Geoff's
'self-flagellation' point seems about right here - what's the real advantage,
other than the warm fuzzy feeling of adhering to stricter standards?


One could as easily turn that around. If you make appropriate
separation of content and presentation, which I gather you accept as a
good thing, what's the advantage of validating against a DTD with a lot
of legacy junk in it?

An example of an advantage to Strict is if you're cutting and pasting
out of old pages, and you thought you'd got rid of all the old FONT
elements, but missed some.

If one has a bunch of valid Transitional pages, then turning them into
Strict pages (if one doesn't need to make other changes anyway) is
probably akin to self-flagellation. But if one is making a *new* page
then I know no advantage to using Transitional. Well OK, except in two
situations:
- if you will help the reader by opening a new window, as mentioned
above (rare);
- if you work for an organisation that still has Netscape 4 as its main
browser (talk about self-flagellation...)

But I agree with John Dunlop when he says that what matters is
understanding what you're doing. Strict isn't a magic wand - just a prod
in the right direction.

--
Stephen Poley
Jul 17 '05 #14
I noticed that Message-ID: <ls********************************@4ax.com>
from Stephen Poley contained the following:
I know just one thing that Strict rules out that is *occasionally*
wanted, and that is being able to open new windows with the target
attribute. But in approximately 95% of cases where websites open a new
window there is no good reason to do so.

I can think of loads of meaningful uses.

Looking at a larger version of a thumbnail
Explanatory notes.
Opening other types file, eg Word documents
Browsing large indexes
Running sub queries on a database

I find new windows useful for me in these and many other circumstances

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #15
Geoff Berrow wrote:
I noticed that Message-ID: <c1**********@phys-news1.kolumbus.fi> from
Wÿrm contained the following:
I am not sure if it can be counted as argument or any good reason, but
depending doctype, browser might end up different "rendering mode"

http://gutfeldt.ch/matthias/articles...tch/table.html

(see difference between strict html 4.01, transitional 4.01 and transitional
4.01 with "loose" doctype rendiering modes for browsers)...

Indeed, but all this does is show that if I use <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
my pages will be rendered in a standard way. It doesn't say anything
about the advantages of strict, AFAICS.


Indeed, it doesn't. The difference between Strict and Transitional is
not so much the rendering mode, but rather the available set of elements
and attributes.

I'm a little cynical about this as you can tell. I think some coders
tend to self-flagellate. Emotive words like 'strict' versus
'transitional' and 'loose' encourage this and tend to create impressions
which do not hold up to scrutiny.


Definitely. HTML Strict and HTML Transitional are just different DTDs,
with different features.

But the difference between Standard mode and Quirks mode is very real
(and a major PITA).
Matthias

Jul 17 '05 #16
On Wed, 25 Feb 2004 12:44:39 +0100, Stephen Poley
<sb******************@xs4all.nl> wrote:
But HTML Strict does rule out quite a lot of stuff - is it really
cost-efficient to have a CSS class for a one-off bit of highlighting?
??. Strict doesn't stop you from using inline styles if you want that.

[...]One could as easily turn that around. If you make appropriate
separation of content and presentation, which I gather you accept as a
good thing, what's the advantage of validating against a DTD with a lot
of legacy junk in it?


Ah, yes of course. I wasn't thinking straight there. Possibly I meant is it
worth the bother having to write

<span style='font-weight: bold;'>xxx</span>

Instead of just

<b>xxx</b>

... but this isn't much of a point really, so I withdraw that objection :-)

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>
Jul 17 '05 #17
R. Rajesh Jeba Anbiah wrote:
Cameron <fo*@bar.invalid> wrote in message news:<c1**********@newsg3.svr.pol.co.uk>...
R. Rajesh Jeba Anbiah wrote:
I would like to know what HTML standard will be better for PHP
webapplications? Right now, I use HTML 4.01 Transitional. And like to
know what *you* PHP programmers prefer? and which is good? TIA.


Well it doesn't really matter what version of HTML you use (XHTML is
still HTML just newer) they are two different things, PHP is handled
server side, (X)HTML handled client side, providing you output it
correctly either will work, I however use XHTML as I prefer it.

Thanks for your reply. IIRC, since PHP 4, they've added something
like XHTML compliant especially in nl2br(), highlight_file(),... But,
I hardly seen such XHTMLed PHP scripts. May I know the reason behind
your preference?


My reasoning was based mostly on the fact that it's technically a new
version of HTML, it's much cleaner in my opinion than previous versions,
and it's backwards compatible, so really I couldn't see a reason not to
use it.

~Cameron
Jul 17 '05 #18
With total disregard for any kind of safety measures Andy Hassall
<an**@andyh.co.uk> leapt forth and uttered:
Ah, yes of course. I wasn't thinking straight there. Possibly I
meant is it worth the bother having to write

<span style='font-weight: bold;'>xxx</span>

Instead of just

<b>xxx</b>

... but this isn't much of a point really, so I withdraw that
objection :-)


No, because you should be using <strong></strong> anyway.

--
Phil Roberts | Dork Pretending To Be Hard | http://www.flatnet.net/
Jul 17 '05 #19
On Wed, 25 Feb 2004 14:04:35 -0600, Phil Roberts
<ph*****@HOLYflatnetSHIT.net> wrote:
With total disregard for any kind of safety measures Andy Hassall
<an**@andyh.co.uk> leapt forth and uttered:
Ah, yes of course. I wasn't thinking straight there. Possibly I
meant is it worth the bother having to write

<span style='font-weight: bold;'>xxx</span>

Instead of just

<b>xxx</b>

... but this isn't much of a point really, so I withdraw that
objection :-)


No, because you should be using <strong></strong> anyway.


But if you want to use <b>, no-one is stopping you. It's in the Strict
DTD (though some people think it shouldn't have been).

--
Stephen Poley
Jul 17 '05 #20

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

Similar topics

24
by: Nobody | last post by:
Okay, you are all so smart in here. Answer me this: IE6 in standards mode doesn't seem to hide scrollbars on the body element (overflow:hide) Ain't this a quandary. I have it in my head that I...
59
by: Philipp Lenssen | last post by:
I've tested some of the new Nokia 6600 functionality. It ships with WAP2 and XHTML Support (it says). What it does is check the Doctype -- if it's not the XHTML Mobile Profile Doctype, but a...
32
by: jp29 | last post by:
My take on problems composing, serving and rendering XHTML documents/web pages: 1. Typical conscientious web authors are producing XHTML documents (Web pages) that feature valid Markup and with...
16
by: Mcginkel | last post by:
I am trying to find a way to load XHTML content in an Iframe. I use to do this in html by using the following code : var iframeObject = document.createElement("iframe");...
82
by: Buford Early | last post by:
I read this in http://annevankesteren.nl/2004/12/xhtml-notes "A common misconception is that XHTML 1.1 is the latest version of the XHTML series. And although it was released a bit more than a...
3
by: Frank Thomas | last post by:
So, where are we (as an industry) with regards to XHTML? I've been going through a book published in 2002 that promotes the idea that we should all be looking to create new projects as compliant...
12
by: Alex D. | last post by:
How can I stop asp.net from rendering XHTML istead of HTML? My javascripts are rendering wrong because of that. It is rendering &amp; to clients instead of &. Any help? Thanks, Alejandro.
11
by: Michael Powe | last post by:
How can I make an XHTML-compliant form of an expression in this format: document.write("<scr"+"ipt type='text/javascript' src='path/to/file.js'>"+"</scr"+"ipt>"); this turns out to be a...
10
by: Robert Huff | last post by:
Can someone offer suggestions why, on the same server (Apache 2.2.8), this works <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html lang="en-US"> <head> <link rel=stylesheet...
6
by: Guy Macon | last post by:
cwdjrxyz wrote: HTML 5 has solved the above probem. See the following web page: HTML 5, one vocabulary, two serializations http://www.w3.org/QA/2008/01/html5-is-html-and-xml.html
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.