HTTP_USER_AGENT is a variable that was used back in the day of PHP3, before the introduced the PHP4 superglobals... problem is that they are a bit insecure now, and I think are disables by a lot of hosts and possibly by default in the php.ini file.
Instead of using $HTTP_USER_AGENT try using: $_SERVER['HTTP_USER_AGENT'] -- this will likely fix your problem. Aside from that you will need to reenable the global option that puts your super globals back into standard global variables (PHP3 style).
Hope that helps.