Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
At what point do you want to know this information? Is it going to be when they are requesting a page that is being fed to them by a Perl script? Is it when you're going through the logs later on with a Perl script? How are they "coming" to your system? HTTP? FTP? Telnet?

Now, to make a few assumptions: You are refering to HTTP traffic as it is being requested through CGI. In this case, you could either attempt to track down the IP number the requestor is giving using IP::Country, Apache::Geo::IP, or just Geo::IP, accepting the fact that some IP numbers are multi-national and also that a user can be in one location, requesting a document through a proxy located somewhere totally else.

Another option is that you could check the values of Accept-Language and assume they are where their first choice is (although this is going to be set to US most of the time by default) or look within the User-Agent field for some value that might be set. Using this method (or one like it) you have to accept that the requestor can put bad data into the header, so it, too, cannot be guaranteed to be correct.

- - arden.


In reply to Re: How to check the origin ofi a visitor? by arden
in thread How to check the origin ofi a visitor? by cranberry13

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-26 07:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found