PHP to answer HEAD requests

--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
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 [at] llgc.org.uk> Ff=F4n/Tel. +44 1970 632 =
582
Peiriannydd Meddalwedd Senior Software Engineer
Llyfrgell Genedlaethol Cymru National Library of Wales





--Apple-Mail-18--642332710--
Dan Field [ Fr, 18 Dezember 2009 11:38 ] [ ID #2026500 ]

Re: PHP to answer HEAD requests

2009/12/18 Dan Field <dof [at] llgc.org.uk>:
> 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 <dof [at] llgc.org.uk> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 Ff=C3=B4n/Tel. +44 1970 632 582
> Peiriannydd Meddalwedd =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Senior Software Engineer
> Llyfrgell Genedlaethol Cymru =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 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=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
Richard Quadling [ Fr, 18 Dezember 2009 11:45 ] [ ID #2026501 ]
PHP » gmane.comp.php.general » PHP to answer HEAD requests

Vorheriges Thema: Re: Logic of conditionals and the ( ) operators (RESOLVED)
Nächstes Thema: $_POST is empty , but were are the variables posted??