Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

cgi variable to get ip address, client machine and browser

Engaged ,
Oct 28, 2013 Oct 28, 2013

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,

Regards,

Iccsi,

2.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Oct 28, 2013 Oct 28, 2013

<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

...
Translate
Enthusiast ,
Oct 28, 2013 Oct 28, 2013

<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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 28, 2013 Oct 28, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 28, 2013 Oct 28, 2013
LATEST

Thanks a million for the information and help,

Regards,

Iccsi,

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources