This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function hostip_get_info($ip) { | |
$content = @file_get_contents('http://api.hostip.info/?ip='.$ip); | |
if ($content != FALSE) { | |
$xml = new SimpleXmlElement($content); | |
$coordinates = $xml->children('gml', TRUE)->featureMember->children('', TRUE)->Hostip->ipLocation->children('gml', TRUE)->pointProperty->Point->coordinates; | |
$longlat = explode(',', $coordinates); | |
$location['longitude'] = $longlat[0]; | |
$location['latitude'] = $longlat[1]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// SETUP: | |
// 1. Customize all the settings (stripe api key, email settings, email text) | |
// 2. Put this code somewhere where it's accessible by a URL on your server. | |
// 3. Add the URL of that location to the settings at https://manage.stripe.com/#account/webhooks | |
// 4. Have fun! | |
// set your secret key: remember to change this to your live secret key in production | |
// see your keys here https://manage.stripe.com/account |