Jump to content

[RST] IP Locator

Recommended Posts

Tind sa ii dau dreptate lui Lubbock


Inlocuiesti cu IP-ul pe care vrei sa-l cauti si iti da toate datele despre el.

EDIT: Sau daca vrei demo:



<form action="" method="post">
IP: <input type="text" name="ip"><input type="submit" value="Verifica">
<br />
$ss = file_get_contents("http://api.ipinfodb.com/v2/ip_query.php?key=409f44a12b8bccd245b898f11300a54abfb709ca89f4ce8905d12e21f4bbe982&ip=" . $_POST['ip']);
echo "Cod tara: ", get_string_between($ss,'<CountryCode>','</CountryCode>');
echo "<br />Tara: ", get_string_between($ss,'<CountryName>','</CountryName>');
echo "<br />Oras: ", get_string_between($ss,'<City>','</City>');
echo "<br />Latitudine: ", get_string_between($ss,'<Latitude>','</Latitude>');
echo "<br />Longitudine: ", get_string_between($ss,'<Longitude>','</Longitude>');

function get_string_between($string, $start, $end){
$string = " ".$string;
$ini = strpos($string,$start);
if ($ini == 0) return "";
$ini += strlen($start);
$len = strpos($string,$end,$ini) - $ini;
return substr($string,$ini,$len);

Edited by Dragos

Share this post

Link to post
Share on other sites
Nytro, daca ai face un program sa aflu ip-ul celui cu care vorbesc pe mess... ai fii de nota 1000000 !


@caramea: Nu vezi ca are user Chioara !? =) Cum poti sa-ntrebi daca vede..

Nici tu nu prea vezi :D

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...