Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

machine name

Status
Not open for further replies.

nappaji

Programmer
Mar 21, 2001
76
US
I have a CGI script called abc on my web server - server1.

If I run this script from a browser on a machine /workstation named machine1, is there a way of determining/getting the name of machine1 thro' CGI??

In short, is there a way of determining on what host we are running our script???

Thanks
 
to get the machine name do:
Code:
$ENV{'SERVER_NAME'}

to see all available environment variables loop through the %ENV hash,like this:
Code:
foreach (keys %ENV) {
	print $_ , &quot;: &quot; , $ENV{$_} , &quot;<br>&quot;
}

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top