Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Nicholas Shanks
April 26, 2005, 4:56 pm
rate this thread
I would like to use PHP (or any other server-side technique) to detect
way to do this, and if not, why not!
I realise I could serve one page to both, and have the basic function
there by default and use DOM to replace it with another, but it would
be more efficient and lower overhead to serve different pages to
different UAs. Any suggestions welcome.
would be required to declare so in the Accept-Content HTTP header they
Since I am not on usenet much, could anyone who replies pleace CC my
No, because it is a clientside setting serverside environments don't
know until told (by the client).
How do you know what page to serve? That is what you are asking!
What DOM (if any)?
I beg to differ, serverside UA sniffing is almost always very poorly
implemented (take a look at the browsercap function and have a good
laugh). But than again clientside UA sniffing is also faulty in many
If you really want to server different pages to different available
capabilites there is an easy way to distinguis between js and nojs:
*** Nicholas Shanks wrote/escribió (Tue, 26 Apr 2005 11:56:41 +0100):
to server (hidden form field or URL attribute, cookie...) and read that
value afterwards from PHP. Just be aware that cookies can be disabled and
user may reach your page skipping the inicial test page.
However, I'd say its a thousand times easier to just write code that works
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group