Skip navigation
Currently Being Moderated

cgi variable to get ip address, client machine and browser

Oct 28, 2013 8:34 AM

I want to use CGI variable to get client information like IP Address, Machine Name and browser name and version,

I just get REMOTE_ADDR for IP address, but I can not get machine name using REMOTE_HOST, nor browser information,


I would like to know do I need any set at server level to get this client informaiton using CGI variable?

If not, are there any server variable available to get client informaiton?

Your help and information is great appreciated,





  • Currently Being Moderated
    Oct 28, 2013 8:45 AM   in reply to iccsi

    <cfdump var="#CGI#">


    will show you what you can get.


    The REMOTE_HOST being empty is possible; it happens on some DNS configurations I recall.


    Adobe say this: "Because the available variables depend on the server, browser, and the types of interactions between the two, not all variables are normally available, and are represented by empty strings in the debug output." in addition they say this about CGI.REMOTE_HOST: "If the server does not have this information, it sets REMOTE_ADDR and does not set REMOTE_HOST."


    What you get back in the CGI scope depends on many things in the client, and the client may even withhold some information depending on local settings or security setup etc.

    Mark as:
  • Currently Being Moderated
    Oct 28, 2013 12:40 PM   in reply to iccsi

    The only browser information you can get from the server-side is the user agent string, and it can be easily spoofed.  I'm sure you can find a library out there which can break down the strings and give you some basic information, but it may be a more reliable process to instead have the client determine via JavaScript what browser and version it is.


    Also, you should be mindful that things like an IP addres are not a definitive way of determining individual users.  People can access your site through a proxy server, which presents multiple users access to the internet behind a single IP address.

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points