Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

what is the main application of header() function in php.........plz
explain in clear and depth

........i am the newbie of ..php ...so with practical examples also

Re: header()

java.inet@gmail.com contained the following:

Quoted text here. Click to load it

plz RTFM
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

Re: header()

java.inet@gmail.com kirjoitti:
Quoted text here. Click to load it

First you should know what http headers are. All you need to know about  
php's header() is that if you want to send specific headers, other than  
what the server sends by default, you use header to set them. Here's a  
good page to start with: http://www.cs.tut.fi/~jkorpela/http.html

For example, here's what Google sends, when you open the index page:

HTTP/1.x 200 OK
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Content-Encoding: gzip
Server: GWS/2.1
Content-Length: 1731
Date: Fri, 01 Jun 2007 12:50:35 GMT

It's just basic info for the browser, what charset the browser should  
use to display the page (utf-8), how it should render it (html), how big  
file it is...

You can do plenty of useful things with headers, Google is your friend.


"Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze

Re: header()

java.inet@gmail.com wrote:
Quoted text here. Click to load it

You can start here:


Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: header()

On Jun 1, 7:30 am, java.i...@gmail.com wrote:
Quoted text here. Click to load it

clear = header() is used to send a raw HTTP header.

in depth = Make yourself a pot of coffee and free up a weekend for an
"edge-of-your-seat" reading session here -> http://www.faqs.org/rfcs/rfc2616

I tend to agree with Geoff... RTFM (sorry, but better for you this way
in the long run; see quote below); but then if you still don't get
it ... RTFRFC!

"Feed a man a fish - feed him for a day; Teach a man to fish - feed
him for a lifetime"
   fname -> Gene,
   lname -> Kelley,
   email -> phpcodehead@gmail.com,
   city  -> Villa Ridge,
   state -> Missouri,
   cntry -> USA

Re: header()

On Jun 1, 5:30 am, java.i...@gmail.com wrote:
Quoted text here. Click to load it

One of the main things I use for it is "Location:". Basically, you can

header("Location: http://www.blah.com ");

It is basically a redirect. So, for example, if you accept form data
and want to redirect to a new page depending on what you receive, you
can use the header() function.

- Paul

Site Timeline