Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Http code that precedes the html tags

Reply
Thread Tools

Http code that precedes the html tags

 
 
Gus Richter
Guest
Posts: n/a
 
      02-06-2009
Judge Judy wrote:
> On Wed, 04 Feb 2009 04:37:28 -0500, Gus Richter
> <(E-Mail Removed)> wrote:
>
>> Judge Judy wrote:
>>> What does the http code before the <HTML> tag look like?
>>>
>>> I know that I can put cookies in the meta tags of the header block,
>>> however when I try to put it before the <HTML> tag it does not work.
>>> I don't understand what format the http code takes. There are
>>> riduculous long winded RFCs on just the HTTP version (who reads or
>>> writes this stuff), but none on how to send the HTTP to a browser.

>>
>> HTTP is the protocol used by the Browser (Client) requesting data to be
>> transfered to it from a Server which then answers back and sends the
>> data requested.
>>
>> <http://searchwindevelopment.techtarget.com/sDefinition/0,,sid8_gci214004,00.html>
>> Hypertext Transfer Protocol:
>> <http://en.wikipedia.org/wiki/Http>
>>
>> The Server sends the data to the Browser (Client) via packets using TCP/IP:
>> <http://en.wikipedia.org/wiki/Internet_protocol_suite>
>>
>> The Data which the Server sends is the Web Page which you mention in
>> your posting with the reference of <html>.
>>
>> HTML (HyperText Markup Language) in it's latest version is 4.01:
>> <http://www.w3.org/TR/html4/>
>> has specific rules for the structure of a W3C conforming HTML Document
>> (Web Page), like so:
>>
>> There must be a Doctype Declaration.
>> <html>
>> <head>
>> contains permittted HEAD elements
>> </head>
>> <body>
>> contains permitted BODY elements
>> </body>
>> </html>
>>
>> The only thing permitted before the <html> tag is the Doctype
>> Declaration, which normally should be this one:
>>
>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
>> "http://www.w3.org/TR/html4/strict.dtd">
>>
>> If you place a META element (which is only permitted to be in the head
>> section) outside of the head section as you say you did, then you should
>> not be surprised that things don't work.
>>
>> You can only change HTTP within the browser software and/or within the
>> server software and there is no reason whatsoever for you to want to do so.

>
>
> I think you misunderstood me. I followed the example on
> http://en.wikipedia.org/wiki/HTTP_cookie
>
> A server would set a cookie using the Http
>
> HTTP/1.1 200 OK <= I don't know if I need this ??
> Content-type: text/html
> Set-Cookie: name=value; ....
>
>
> I looked at other exampes and they did not include the
> "HTTP/1.1 ... " line.
>
> I tried with and without the HTTP line without sucess.



I believe that it is you that did not understand me. The html document
structure is (should be) as I said. The http header exchange between
browser/server is in the background which you have no access to
directly. When you introduce a cookie via meta (as in your example
below) or script (browser-side or server-side), it is added to the http
header automatically - you do not access the http header directly, as I
understood you to say.


> ------------------------------------------------------------------------
>
> The HTML would put the cookie in the meta-tag
>
> <HTML>
> <head>
> <meta http-equiv=Set-Cookie: name=value; ...... >
>
> </head>
>
> etc
>
> I am able to generate a cookie from a static page, and I can create
> and manage cookies using a javascript. I think managing cookies on
> the client side cookies is very secure.



Search using cookies and security as keywords and do a bit of reading.

--
Gus
 
Reply With Quote
 
 
 
 
dorayme
Guest
Posts: n/a
 
      02-06-2009
In article <HfSil.17860$(E-Mail Removed)>,
"rf" <(E-Mail Removed)> wrote:

> Before the <html> tag there may be a doctype.
>
> Before that (or the <html> tag) there is a single empty line.


Can you say more about the need for the single empty line before a dd?
Is this something the server adds somehow or something that one should
have in ones html docs before loading up to a server? Is there some fine
point here that I need to know about?

--
dorayme
 
Reply With Quote
 
 
 
 
rf
Guest
Posts: n/a
 
      02-06-2009
dorayme wrote:
> In article <HfSil.17860$(E-Mail Removed)>,
> "rf" <(E-Mail Removed)> wrote:
>
>> Before the <html> tag there may be a doctype.
>>
>> Before that (or the <html> tag) there is a single empty line.

>
> Can you say more about the need for the single empty line before a dd?
> Is this something the server adds somehow or something that one should
> have in ones html docs before loading up to a server? Is there some
> fine point here that I need to know about?


It's nothing you need to worry about. It's to seperate the HTTP response
headers from the response body (the bit you know of as an HTML page). The
headers have to go in the TCP/IP message somewhere. They go at the front of
the message, followed by a empty line, followed by your HTML.

The headers are usually put there by the HTTP server. You can, however,
cause different headers to be sent using, for example, PHP. Once again
though you don't need to worry about where those headers are.

Here is a picture of a HTTP request made using telnet:

http://en.wikipedia.org/wiki/File:Ht...net_ubuntu.png

You can also look at the headers using firebug, the net tab, expand the GET.
Firebug helpfully seperates the headers from the response body (remember the
empty line delimiter) and presents them in two seperate tabs.

Similar stuff happens with email and usenet. Cause your newsreader to
display a raw NTTP message. You will see the NTTP headers, an empty line and
then the actual message.


 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      02-07-2009
In article <HK1jl.17962$(E-Mail Removed)>,
"rf" <(E-Mail Removed)> wrote:

> dorayme wrote:
> > In article <HfSil.17860$(E-Mail Removed)>,
> > "rf" <(E-Mail Removed)> wrote:
> >
> >> Before the <html> tag there may be a doctype.
> >>
> >> Before that (or the <html> tag) there is a single empty line.

> >
> > Can you say more about the need for the single empty line before a dd?
> > Is this something the server adds somehow or something that one should
> > have in ones html docs before loading up to a server? Is there some
> > fine point here that I need to know about?

>
> ...It's to seperate the HTTP response
> headers from the response body (the bit you know of as an HTML page). The
> headers have to go in the TCP/IP message somewhere. They go at the front of
> the message, followed by a empty line, followed by your HTML.


Righto. I see.

--
dorayme
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
HTTP SOAP/HTTP GET/HTTP POST milan_9211 Software 0 01-10-2011 02:10 PM
All style tags after the first 30 style tags on an HTML page are not applied in Internet Explorer Rob Nicholson ASP .Net 3 05-28-2005 03:11 PM
html tags within meta tags allowed? Donald Firesmith XML 5 01-08-2005 11:29 PM
RegEx to find CFML tags nested in HTML tags Dean H. Saxe Perl 0 01-03-2004 06:11 PM



Advertisments