1
0
Fork 0
forked from 0x2620/oxjs

add ipv4 map example

This commit is contained in:
rolux 2012-06-21 23:17:02 +02:00
commit d5e2fcc1c2
15 changed files with 1488 additions and 0 deletions

View file

@ -0,0 +1,14 @@
<?php
// ipv4map.php - no copyright 2011 0x2620.org - public domain
$data = array();
$data['host'] = $_GET['host'] ? $_GET['host']
: gethostbyaddr($_GET['ip'] ? $_GET['ip'] : $_SERVER['REMOTE_ADDR']);
$data['ip'] = $_GET['ip'] ? $_GET['ip']
: $_GET['host'] ? gethostbyname($data['host']) : $_SERVER['REMOTE_ADDR'];
header('Content-Type: text/javascript');
echo $_GET['callback'] . '(' . json_encode($data) . ')';
?>