PHP headers... please brief explanation of headers is needed

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
danselstudios
Forum Newbie
Posts: 24
Joined: Sat Jun 03, 2006 10:47 am
Location: Corona, CA

PHP headers... please brief explanation of headers is needed

Post by danselstudios »

first of all, any great links to tutorials or guides to learning about HTTP headers, please post them.

what do they do? which ones are necessary?

how do i place them with PHP?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Headers tell the web browser what do with the content it is receiving. For example, if the headers tell the browser that the content-type is text/html the browser will render it. If they tell the browser it's application/zip the browser will ask you to save it.

The status code returned may suggest to your browser that it should use the cached version or that it should download the page again... there are all kinds of things you can do with headers.

header() is used to send HTTP headers in PHP before you generate any output.

Take a look at the RFCs for the HTTP/1.1 and 1.0 protocols for a good bit of information :)
danselstudios
Forum Newbie
Posts: 24
Joined: Sat Jun 03, 2006 10:47 am
Location: Corona, CA

Post by danselstudios »

thanks man, thats really helpful...i was really lost until now.

i'll look more into it now, thats for sure.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

I was just reading about output buffers in this article, but this gives a down and dirty explanation of headers as well as OB...
http://www.zend.com/zend/art/buffering.php
Post Reply