Is there a way to echo the header information of a webpage, for example:
Server: Microsoft-IIS/7.0
etc....
Is there a way to echo the header information of a webpage, for example:
Server: Microsoft-IIS/7.0
etc....
There appears to be a nice little script someone wrote for this, complete with all the if/else if/else statements.
If you want to see the headers as received by the browser, then use something like LiveHTTPHeaders, FireBug, or HTTPFox. All are for Firefox. Personally I use HTTPFox and Firebug the most.
Server-side, you can use headers_list() as stated earlier, with the proviso it can only show headers that have been set already. If something adds/changes headers later in the script's execution, then you'll be displaying "stale" information.
headers_list() will return the headers of your own webpage in an array. If you want some other servers headers there's a function named get_headers(). To print it you can either var_dump() it or echo in a foreach.