2 html files in ONE server reply
I know that every single html file has to have exactly ONE <html>...</html> part.
But is it OK to send a sequence of such files all in one http reply?
No browser I've tested so far did ever complain, results look nice.
But do I violate any standards this way?
Haven't found any answers (w3c.org,...) yet.
Yes, you have violated the basic standards of both HTTP and HTML. Browsers will do their best to render whatever data is sent to them, regardless of any violations of various standards. So when you're sending multiple files at once, the browser simply treats it as a single HTML file and renders them all - one after the other.
For simple layouts, you'll probably get reasonably readable results, but sooner or later this practice will cause problems for you. You need to find a way to assemble everything into a single, valid HTML file.
OK, I won't do it again, I promise ;-)
At least---as this was only a quick-n-dirty solution for my own use, I haven't done any harm to the world.
But now I'm still curious: You seem to know an authoritative source. Could you please point me to it?
Thanks in advance!
^This^ was meant to be a reply to rtrethewey (#2 above).
Originally Posted by tilman victor
How can i do this right next time?
An alternative to building one file would be to make them PHP include files. This is particularly useful for repetitive information that you want to appear on multiple web pages. That way when the info changes, you only have to amend it once and all the pages are updated.
jedaisoul's suggestion about "include"s is one solution. It all depends on what you're trying to accomplish. Why are you using multiple files?
I really don't WANT to do that.
(What I, forum-newbie, would like to "do right next time" is to reply to
a specific post instead of writing beneath the whole thread.)
The story is just the other way round:
For quite a while I was working with a concatenation of originally stand-alone html-snippets and was happy to see everything in one place.
Then one day I looked at the source...
But, just for the sake of curiosity---as promised, I won't do it in public:
After all, isn't what we call a html-document perfectly encapsulated by
And once the http is done (CRLF,CRLF), isn't it OK to send whatever you
have announced as "content-type:" as many times as you like?
Does anyone know an authoritative source for further reading?
My every-search-engine-I-know-foo seems to be very very weak...
linux virtual private server
it is possible in programming language there is
combine two <html> files in one .....
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread