Home arrow PHP arrow Page 3 - HTTP Headers in Web Development

How Headers Are Used - PHP

At this point, you may not know what HTTP headers are, but you use them all the time, both as an Internet user and as a web developer, even if you are not aware of it. The beginning of this article is a short introduction to HTTP headers, including what they are, and what they do. Later in the article, we cover some common uses of HTTP headers in web development.

  1. HTTP Headers in Web Development
  2. What do HTTP headers look like?
  3. How Headers Are Used
  4. Examples of HTTP Header Usage
By: John Best
Rating: starstarstarstarstar / 14
August 26, 2008

print this article



This is nice to know, but how can it be used? Is there some way to set the HTTP response headers? Can one just put them at the top of a web page?

We will address these questions in reverse order.

Can one put HTTP headers at the top of a web page? Not as such, but there is a Meta tag that can be used in the head section of a web page that provides the same functionality, and uses the same syntax. This is the http-equiv tag. This is an example:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Notice that it looks very similar to the Content-Type: header in the response that was returned by Google in the example above.

Is there some way to set the "real" HTTP response headers? There are two ways to set them. The first is to set them in the server configuration directives. And the second method is to set them using a web scripting language such as PHP, or Perl.

How can HTTP headers be used in web development? There are numerous uses, both for communication between web page and browser, and communication between web pages.

In the next section, I will provide you with a few examples of the many uses of HTTP headers.

>>> More PHP Articles          >>> More By John Best

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: