[sharing] Find You IP & Domain Info - php

wanipiro

Newbie
Joined
Apr 3, 2017
Messages
10
Reaction score
6
find your ip info:

php code:

Code:
<?php

$myip=$_SERVER['REMOTE_ADDR'];

$string = file_get_contents("https://get.apigeoip.com/json/".$myip);

$json_a = json_decode($string,true);

echo '<table>';

foreach ($json_a as $key => $value){

  echo  '<tr><td>'.$key . '</td><td> : ' . $value.'</td></tr>';

}

echo '</table>';

?>


demo: https://apigeoip.com/myip.php

find domain ip info:

php code:

Code:
<?php

$getdomain=$_GET['domain'];

$domainip=gethostbyname($getdomain);

$string = file_get_contents("https://get.apigeoip.com/json/".$domainip);

$json_a = json_decode($string,true);

echo '<table>';

foreach ($json_a as $key => $value){

  echo  '<tr><td>'.$key . '</td><td> : ' . $value.'</td></tr>';

}

echo '</table>';

?>


dont forget to add ?domain=domainname.com

demo: https://apigeoip.com/domain.php?domain=blackhatworld.com

hope this help :D
 
Back
Top