|
Posted by d43m0n AT shaw DOT ca on 09/21/06 16:48
The Eclectic Electric wrote:
> "d43m0n AT shaw DOT ca" <barryd.it@gmail.com> wrote in message
> news:1158852251.978947.133750@m73g2000cwd.googlegroups.com...
> >
> > J.O. Aho wrote:
> >> 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.
> >>
> >>
> >>
> >> //Aho
> >
> > What the heck are you two talking about, the only way you can tell the
> > browser which favicon to use is in the meta data within HTML. The only
> > thing that php could possible do is apon favicon.php is return base64
> > data of an image through the use HTTP header functions. Often browsers
> > use the defualt favicon.ico in the root of the web directory.
> >
>
> I don't think I understand. The favicon HTML is returned as part of the
> page served after going through the PHP engine yes? If you could determine
> which types the browser supported at that stage then you could surely echo
> back the relevant HTML? I'm thinking now, as it's a <LINK REL="icon" />
> that there would then be *another* HTTP request to the web server in order
> to retrieve the icon, but that this wouldn't come through the PHP engine and
> so there's still no way you can determine what it would be accepting.
>
> Now I'm wondering if I can force it through the PHP engine...
>
> <link rel="shortcut icon" href=http://www.example.com/favicon.php />
>
> This is really distracting!!!!
>
> +e
Of course it would work, all you need is HTTP header responce to
consist of the image, that means binary data, encrypted into base64,
and content-type defined. within the header too. Look at the manual for
examples, look for http header().
If you want to have the images in seperate files, youll need to use a
buffer and fread or get file contents to send to teh client.
But, if its to advanced... best not be in the game.
~Daemon
[Back to original message]
|