|
Posted by The Eclectic Electric on 09/21/06 15:44
"J.O. Aho" <user@example.net> wrote in message
news:4nfk9hFa4n8iU1@individual.net...
> The Eclectic Electric wrote:
>> Is it possible to interrogate the HTTP accept header for specific items?
>> What I'm looking to do is to see whether the browser will accept gifs for
>> the favicon as per standard and serve either an animated gif or a normal
>> ico as appropriate.
>
> You can use $_SERVER['HTTP_USER_AGENT'] to see what web browser the user
> is using, and from that compare to a list that you have to see which type
> of icon is supported and deliver the type of favicon to them.
>
Thanks. Browser identification is fraught with all sorts of dangers though,
and I was hoping to do it more elegantly.
To be honest, it was someone else's idea to interrogate the accept header
and I'm not sure whether his or my interpretation of how HTTP works is
correct (probably his!). He was implying that the browser sends up
individual HTTP requests for each element of the page, which would mean it
should indeed be possible to catch whether or not it was possible to send a
gif for the favicon. My interpretation is that the request was for the
whole page, which would mean that the accept header was for the whole page
and therefore it wouldn't be possible to determine whether gif was
acceptable or not. But then, does it send another request up for the LINK
REL? Honestly, I'm out of my depth!
+e
Navigation:
[Reply to this message]
|