Musings of a Manchester Drupal guy

Drupal, Open Source, Analytics, Social Media.

Sunday, October 24, 2004

Obtaining the Servers Windows Name

This is a useful trick to know


inet = CreateObject("java", "java.net.InetAddress");
inet = inet.getLocalHost();
inet = inet.getHostName();
writeOutput(inet);


I use it for detecting the environment code is on i.e. the development, staging and live servers.