Posted by ZeldorBlat on 10/04/07 11:59
Benjamin wrote:
> you use a function called get_browser()
> it takes no parameters and anaylzes the HTTP_USER_AGENT
> it return an assoctive array
> you check "javascript" key and if it is set to 1 then javascript is
> enabled
> For example:
> $results = get_browser();
> if ($results["javascript"] == 1) {
> echo "You have javascript";
> }
>
> One thing you need to now is you must set the browscap.ini in your
> php.ini file to the location of you browscap.ini. You can get one at
> http://browsers.garykeith.com/downloads.asp
>
> Happy detection
> Jim wrote:
> > How do I check if javascript is enabled in PHP?
> >
> > TIA,
> >
> > Jim
Of course that will only tell you if the browser /supports/ JavaScript
-- not whether it is actually enabled or not.
Your best bet is probably to use JavaScript to do something like set a
form variable then check if that variable got set when you process the
form.
Navigation:
[Reply to this message]
|