error, Duplicate tag (HTML). [message #59699] |
Sun, 28 October 2007 04:01 |
Eclipse User |
|
|
|
Originally posted by: samw3office.gmail.com
Hello All,
I'm getting a "Duplicate tag (HTML)." error on the second <DOCTYPE> tag
in my script as well as a "Duplicate tag (html)." warning on the second
<html> tag.
Is PDT doing this? and if so, can I set it somehow to not do it? (like
ignore or something?)
Thanks!
Sam Washburn
The script I'm using boils down to this...
<?
if($something) {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<body>
DISPLAY ONE FORM
</body>
</html>
<?
} else {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<body>
DISPLAY DIFFERENT FORM
</body>
</html>
<?
}
?>
|
|
|
Re: error, Duplicate tag (HTML). [message #59723 is a reply to message #59699] |
Sun, 28 October 2007 15:24 |
Eclipse User |
|
|
|
Originally posted by: ganoro.gmail.com
The HTMLValidator generates this error message. Semnatically your snippet
is valid though consider using this equivalent snippet.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<body>
<?
if ($something) {
?>
DISPLAY ONE FORM
<?
} else {
?>
DISPLAY DIFFERENT FORM
<?
}
?>
</body>
</html>
|
|
|
Re: error, Duplicate tag (HTML). [message #59770 is a reply to message #59723] |
Sun, 28 October 2007 16:31 |
Eclipse User |
|
|
|
Originally posted by: samw3office.gmail.com
Thanks but..
Is the HTMLValidator a part of PDT or just eclipse? It would be nice
if there was a way to selectively choose which errors the validator
calls an error.
The code snippet you offered would solve the problem, however, I my
other code logic makes it a bit difficult.. kind of like this:
<?
if($_REQUEST['form_clicked']){
// Process form here..
// Then redirect to another page.
} elseif($something) {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html><body>DISPLAY ONE FORM</body></html>
<?
} else {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html><body>DISPLAY DIFFERENT FORM</body></html>
<?
}
?>
Roy Ganor wrote:
> The HTMLValidator generates this error message. Semnatically your
> snippet is valid though consider using this equivalent snippet.
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
> <html>
> <body>
> <?
> if ($something) {
> ?>
> DISPLAY ONE FORM
> <?
> } else {
> ?>
> DISPLAY DIFFERENT FORM
> <?
> }
> ?>
> </body>
> </html>
>
>
>
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03471 seconds