blacksorcerer
(van experts-exchange afgepikt) Met ARIN whois een lookup doen: [code]<?php
$ip_address = $_SERVER["REMOTE_ADDR"];
$content = file_get_contents("http://ws.arin.net/cgi-bin/whois.pl?queryinput=$ip_address");
$pos = strpos($content, "<pre") + 4;
$content = substr($content,$pos);
$pos = strpos($content, "OrgName:") + 8;
$content = substr($content,$pos);
$pos = strpos($content, "\n");
$isp_name = trim(substr($content,0,$pos));
$content = substr($content,$pos);
$pos = strpos($content, "City:") + 5;
$content = substr($content,$pos);
$pos = strpos($content, "\n");
$city = trim(substr($content,0,$pos));
$content = substr($content,$pos);
$pos = strpos($content, "StateProv:") + 10;
$content = substr($content,$pos);
$pos = strpos($content, "\n");
$state = trim(substr($content,0,$pos));
$content = substr($content,$pos);
echo "ISP: $isp_name\n";
echo "City: $city\n";
echo "State: $state\n";
?>[/code]
14 april 2008 10:47