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

cgi variable to get ip address, client machine and browser

Engaged ,
Oct 28, 2013 Oct 28, 2013

Copy link to clipboard

Copied

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,

Views

1.7K

Translate

Translate

Report

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

...

Votes

Translate

Translate
Enthusiast ,
Oct 28, 2013 Oct 28, 2013

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

Thanks a million for the information and help,

Regards,

Iccsi,

Votes

Translate

Translate

Report

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
Documentation