Re: Tips and Tricks
| From: | Colin Viebrock | Date: | Thu, 05 Apr 2001 20:05:21 +0000 |
| Subject: | Re: Tips and Tricks | ||
| References: | 1 | Groups: | php.mirrors |
| Request: | Send a blank email to php-mirrors+get-4656@lists.php.net to get a copy of this message | ||
> I've seen some tips on determining what browser the client is using (i.e.
> parsing the HTTP_USER_AGENT), but I would like to see some information on
> determining the capabilities available to the browser using PHP.
> Specifically, whether the client browser has javascript enabled or
disabled,
> and what plug-ins are installed on the browser (such as Flash, Adobe
Acrobat
> Reader, RealPlayer, etc.).
As far as I know, there is no way for the server to know if the client has
Javascript enabled or not. Not without writing some Javascript code that
explicitly tells the server that JS is enabled.
Nor is there a reliable way for the server to know what plug-ins are
installed. You can parse through $HTTP_ACCEPT, but I doubt that's very
reliable. Again, the only way is write some Javascript code that explicitly
tells the server what plug-ins are installed (assuming that Javascript has
access to this information).
As for some of the other capabilities, you may want to look into the
get_browser() function in PHP. Keep in mind, it will only tell you if the
client's browser is *capable* of Javascript ... not if they have it enabled
or not.
- Colin