On a site I worked with we rely on browser detection in order to send the
correct stylesheet and other bits that make it more compatable on older
browsers. Browser detection is not just used to block unwanted browsers.

On Tue, 4 Mar 2003, Leif K-Brooks wrote:

> Checking browsers is pure evil, but if you must, use
> $_SERVER['HTTP_USER_AGENT'] on the server side.
>
> Ashley M. Kirchner wrote:
>
> >
> >    I know, it can't be done in PHP.  That's not exactly what I'm here
> > for.  I have a client who would like to redirect people to a polite
> > 'upgrade your browser' page whenever people visit his site (which has
> > been developed in PHP no less).  My question here is, how can I make
> > this so that regardless of what URL someone comes in to, it will
> > always run the sniffer prior to loading the actual URL they visited?
> > In other words, whether the visitor comes to the main url
> > (http://www.site.org), or whether they are going to a specific link
> > (http://ww.site.org/seethis/), the client would like the sniffer to
> > check them all.
> >
> >    I know I can stick the whole javascript sniffer into each and every
> > file, but that's just not efficient.  Being that this site was created
> > in PHP, I can very easily stick an 'include' in each file to include
> > the javascript piece, however how can I use the results of that
> > javascript piece inside PHP to then do a Header("Location...") type
> > thing?  Can I even do that considering that javascript normally goes
> > within the <head>...</head> section, at which point the page headers
> > were already sent, and doing a Location redirection within PHP will
> > only result in an error.
> >
> >    Suggestions welcome.
> >
>
> --
> The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
> to decrypt it will be prosecuted to the full extent of the law.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>



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

Reply via email to