Forum Moderators: phranque

Message Too Old, No Replies

SSI is adding a element "HTML" element to my page

I can't see where it's coming from

         

Enigmatic

3:22 am on Sep 4, 2003 (gmt 0)

10+ Year Member



Again I am trying to validate my web page and am having problems. I keep getting the error "document type does not allow element "HTML" here".

I know what is referring to, but have no idea how to fix the problem.

I inserted the following as part of a script I'm using for an online user count.

<!--#include virtual="online.php?page=Homepage"-->

But for whatever reason, instead of this code which was inserted into Dreamweaver, the validator is seeing this.

<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>OnlineBOX</title>

</head>

This code is no where to be seen in Dreamweaver, but it shows up in the validator in place of the "#include virtual" coding. OnlineBOX by the way is the name of the script I used.

I also looked at online.php and don't see any of the code the validator sees either, so I'm completely clueless on how to fix this problem. Help as always, is greatly appreciated.

Enigmatic

tedster

9:57 am on Sep 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm suspicious of the server settings - what server are you on, and is it configured properly for your virtual includes.

This is really not so much a validation issue as it is a technology issue. You already know WHY you can't have a second html element - you just can't figure out HOW it's getting into the page, right?

For this reason, I'm moving the thread from the HTML and Browsers forum over to the Website Technology Issues forum, looking for a different audience and hopefully some fruitful ideas for you.

DaveAtIFG

4:34 pm on Sep 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, I'm confused but that happens all too often, and it IS early in the day for me...

Clarify for me. Your include statement should include whatever code is at online.php?page=Homepage into the page containing the the include statement. Are you saying that it doesn't? Forget DW and the validator for now, surf to online.php?page=Homepage and the page containing the include and view/compare the source.

Enigmatic

7:04 am on Sep 8, 2003 (gmt 0)

10+ Year Member



Dave,

When I view [example.org...] to see the source code, I end up seeing the following code, as the validator sees it in my index page.

<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>OnlineBOX</title>

</head>

<body>

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border: 2px #00CC00" width="150 px" id="AutoNumber1">
<tr>
<td width="100%" bgcolor="#000000"><div align="center"><font size="1" face="Arial">Hits
Today: 2<br>
Current Online Users: 1<br>
Most Online Users Ever: 3</font></div></td>
</tr>
</table>

</body>

</html>

So when I call this page with the virtual element by putting it into my index page, how do I prevent the validator from seeing all of this information? I just want it to see the following:

<!--#include virtual="online.php?page=Homepage"-->

Do I need to recode the online.php page? Or what exactly would be your suggestion? By the way, the source code shown above is one of two necessary php pages in order to get the online user script to work. It's not a script I made, but one I found online. Thanks for your help,

Enigmatic

[edited by: DaveAtIFG at 7:24 am (utc) on Sep. 8, 2003]
[edit reason] Edited URL [/edit]

DaveAtIFG

8:18 am on Sep 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If I understand correctly, you're validating a page that's online on a server. When the server receives a request for the page, it includes the code you don't want the validator to see, THEN serves the page to whoever asked for it, including validators. An include is an instruction to a server to do some "server side" processing before serving a page, so all of that is working as it should. But you want to validate before the include is included. You can't do that to a page that's on a server.

You mentioned Dreamweaver so you're probably using a PC. In my opinion, the best solution is to download CSE HTML Validator Lite (free version) and use it to validate your local copy of the page in a "non-server" environment. Another option might be to find an online validator that allows you to validate a file on your local disk. I think there are a few, or at least there used to be. Online validators vary in their quality and conformity to HTML specs so this is not as good an option in my opinion.

seeber01

1:40 pm on Sep 8, 2003 (gmt 0)

10+ Year Member



When you use the the include function it processes the entire source of the data you are including. So if your online.php?.... has <html> in the source then it is also included. Include sources should not have anything except actual data to be included within the page.

In other words, include sources should be basic text files, not html files.

Hope this helps.
Debs

seeber01

1:42 pm on Sep 8, 2003 (gmt 0)

10+ Year Member



Oops, I should have said also, to fix the problem, just have your source be the table itself, you don't need all the other html/body/head ... that should fix it.

Debs

bakedjake

3:08 pm on Sep 8, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



So when I call this page with the virtual element by putting it into my index page, how do I prevent the validator from seeing all of this information? I just want it to see the following:

<!--#include virtual="online.php?page=Homepage"-->

It's not possible.

That include statement is telling your webserver to go get all of the content that is in that online.php file, and paste it right here. It's happening before the browser ever comes into the picture.

Why don't you code the php file not to return the html elements that you don't want? Better yet, you can code the file to detect when it's being included (check the requested URI), and only return the relevant body parts. When it's being called directly, return all of the html codes. You'll get the best of both worlds.

Enigmatic

9:03 pm on Sep 8, 2003 (gmt 0)

10+ Year Member



seeber01,

Your suggestion to eliminate the <html>, <body>, and <head> tags was absolutely correct. The script still works as it should, but now it also validates. Thanks so much for your help and for teaching me the correct way to do this next time. I really appreciate the help! I also wanted to say thanks to all the rest of you that led me in the right direction! This forum is awesome!

Enigmatic