PHP Classes

Can you give an example ?

Recommend this page to a friend!

      PHP Free GeoIP Location  >  All threads  >  Can you give an example ?  >  (Un) Subscribe thread alerts  
Subject:Can you give an example ?
Summary:Can you give an example to use your class?
Messages:5
Author:Mick89
Date:2013-07-05 10:22:44
Update:2013-07-05 20:59:11
 

  1. Can you give an example ?   Reply   Report abuse  
Picture of Mick89 Mick89 - 2013-07-05 10:22:44
Hi,

Can you give an example to use your class?

I tested this but that does not function.

$object = new netGeo();
$object->getNetGeo();

print netGeo::pickDataFromXML('00.000.00.00');

I am not to develop.
Thanks!

Mick

  2. Re: Can you give an example ?   Reply   Report abuse  
Picture of Frederik Yssing Frederik Yssing - 2013-07-05 12:53:03 - In reply to message 1 from Mick89
$netGeo = new netGeo();
$netGeo->getNetGeo($_SERVER['REMOTE_ADDR']);
echo $netGeo->Ip.'<br />';
echo $netGeo->CountryCode.'<br />';
echo $netGeo->CountryName.'<br />';
echo $netGeo->RegionCode.'<br />';
echo $netGeo->RegionName.'<br />';
echo $netGeo->City.'<br />';
echo $netGeo->ZipCode.'<br />';
echo $netGeo->Latitude.'<br />';
echo $netGeo->Longitude.'<br />';
echo $netGeo->MetroCode.'<br />';
echo $netGeo->AreaCode.'<br />';

You can't really use 00.000.00.00 as a valid ip

  3. Re: Can you give an example ?   Reply   Report abuse  
Picture of Mick89 Mick89 - 2013-07-05 19:05:09 - In reply to message 2 from Frederik Yssing
Thanks ! :)

  4. Re: Can you give an example ?   Reply   Report abuse  
Picture of Mick89 Mick89 - 2013-07-05 19:21:47 - In reply to message 2 from Frederik Yssing
I obtain an error with your example.

PHP Strict Standards: Accessing static property netGeo::$Ip as non static in netgeo.php

An idea?

Thanks again!

Mick

  5. Re: Can you give an example ?   Reply   Report abuse  
Picture of Frederik Yssing Frederik Yssing - 2013-07-05 20:59:11 - In reply to message 4 from Mick89
dooh yes, my bad.
I forgot that I had changed variables and methods to static.

The example is updated now.