PHP to answer HEAD requests

PHP to answer HEAD requests

am 18.12.2009 11:38:28 von Dan Field

--Apple-Mail-18--642332710
Content-Type: text/plain;
charset=ISO-8859-1;
format=flowed;
delsp=yes
Content-Transfer-Encoding: quoted-printable

Is it possible to use PHP to answer HEAD http requests? Is it as =20
simple as doing something like:

header('blah')
exit;

I'd expect PHP to produce a full page rather than just a header though.

--=20
Dan Field Ff=F4n/Tel. +44 1970 632 =
582
Peiriannydd Meddalwedd Senior Software Engineer
Llyfrgell Genedlaethol Cymru National Library of Wales





--Apple-Mail-18--642332710--

Re: PHP to answer HEAD requests

am 18.12.2009 11:45:42 von Richard Quadling

2009/12/18 Dan Field :
> Is it possible to use PHP to answer HEAD http requests? Is it as simple a=
s
> doing something like:
>
> header('blah')
> exit;
>
> I'd expect PHP to produce a full page rather than just a header though.
>
> --
> Dan Field             =C2=
=A0     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

--=20
-----
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=3DZEND002498&r=3D213474=
731
ZOPA : http://uk.zopa.com/member/RQuadling

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php