The documentation page of Net_Geo::Net_Geo()
says that :
The method accepts two parameters :
bool Net_Geo() ( string $applicationName = '' , string $alternateServerUrl = '' )
And those parameters are :
string $applicationName
- Optional application name to use in UserAgent when polling Netgeostring $alternateServerUrl
- URL to Netgeo service script, will be set to "http://netgeo.caida.org/perl/netgeo.cgi" unless changed
You are not passing any of those parameters -- which means the default Netgeo service URL is used...
... And if you try to open it ( http://netgeo.caida.org/perl/netgeo.cgi ), you'll see it doesn't work ; my Firefox says it cannot connect to the server.
This probably explains why your code doesn't produce any expected output : if it relies on a geolocalition server, and that server doesn't work anymore...
As a sidenote : according to the index of pear packages in the Networking section, Net_Geo
is not maintained anymore, and the last version was released in 2006-03-29 ; which is quite not a good sign...
If you can install PECL packages (you'll probably need to be admin of your server), maybe the GeoIP package would interest you.