Re: PHP to answer HEAD requests
| From: | Richard Quadling | Date: | Fri, 18 Dec 2009 10:45:42 +0000 |
| Subject: | Re: PHP to answer HEAD requests | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-300584@lists.php.net to get a copy of this message | ||
2009/12/18 Dan Field <dof@llgc.org.uk>:
> Is it possible to use PHP to answer HEAD http requests? Is it as simple as
> doing something like:
>
> header('blah')
> exit;
>
> I'd expect PHP to produce a full page rather than just a header though.
>
> --
> Dan Field <dof@llgc.org.uk> Ffôn/Tel. +44 1970 632 582
> Peiriannydd Meddalwedd Senior Software Engineer
> Llyfrgell Genedlaethol Cymru National Library of Wales
>
>
>
>
>
$_SERVER['REQUEST_METHOD'] will/should contain the request type.
Documented as ...
"Which request method was used to access the page; i.e. 'GET', 'HEAD',
'POST', 'PUT'.
Note: PHP script is terminated after sending headers (it means after
producing any output without output buffering) if the request method
was HEAD."
See http://docs.php.net/manual/en/reserved.variables.server.php
--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling