Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

How to find Brower name in mod_perl

by Anonymous Monk
on Nov 18, 2009 at 12:14 UTC ( [id://807890]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I am trying to find the brower type using Apache2 and mod_perl. I tried HTTP_USER_AGENT and HTTP_AGENT environment variables. But i can't able to get the details.

Please suggest me to get the brower details.

Thanks in advance.

Replies are listed 'Best First'.
Re: How to find Brower name in mod_perl
by wazoox (Prior) on Nov 18, 2009 at 12:58 UTC
    I don't know anything about modperl, however it looks like you need to use Apache2::Filter and use it to extract the user agent from the headers, something like :
    $f->r->headers_in->{'User-Agent'}

    See the Modperl documentation for more information.

      You don't need filter. You use the request object, usually called $r, which you get passed in the beginning of your handler. It's what you get back from $f->r() there. If you're using ModPerl::Registry, it will also be in %ENV.
Re: How to find Brower name in mod_perl
by Anonymous Monk on Nov 18, 2009 at 18:30 UTC
    Dump %ENV, it sould be there
    use CGI(); print CGI->header, CGI->new(\%ENV)->Dump; __END__

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://807890]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-04-26 09:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found