Adding an app/page to a Facebook Page

I found this article which said to add a page/app to a Facebook Page you need to hit this URL with your two parameters:


https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID &display=popup&next=YOUR_URL

Update: I was trying to add an ‘app’ rather than a ‘page tab’ and it turned out I needed this:


https://www.facebook.com/add.php?api_key=YOUR_APP_ID&pages 

GeoIP with MaxMind’s GeoLite in PHP

You can download the GeoLite Country database from GeoLite Free Downloadable Databases and you can grab the MaxMind GeoIP PHP API.

Once you have the GeoIP.dat file and the geoip.inc PHP file you’re good to go. E.g.:


  require_once __DIR__ . '/geoip/geoip.inc';

  $gi = geoip_open( __DIR__ . '/geoip/GeoIP.dat", GEOIP_STANDARD );

  $country_code = geoip_country_code_by_addr( $gi, $host );
  $country_name = geoip_country_name_by_addr( $gi, $host );

  geoip_close( $gi );