Web Hosting Info

Search:

featured partner

The IP to Country Database

  Forum Topics : Development / Soap Application
Submitted by ruturajv on Tue, 11/23/2004 - 21:48.
Why don't U guys start off a Soap Server which accepts an IP and returns the country name, its code, and the flag urls..
:D
Comment viewing options:
Select your preferred way to display the comments and click 'Save settings' to submit your changes.
Just a work around for the webservice
Posted by ruturajv on Fri, 11/26/2004 - 02:35.
This is a sample PHP script which you can use, You won't have to download the dB ;)
<?php
$ip = $_GET['ip'];

function get_country($ip)
{
    $f = fsockopen('ip-to-country.webhosting.info', 80);
    if (!$f)
    {
        return false;
    }

    $postdata = "ip_address=".urlencode($ip)."&submit=".urlencode('Find Country');


    $request = '';
    $request .= "POST /node/view/36 HTTP/1.1\r\n";
    $request .= "Host: ip-to-country.webhosting.info\r\n";
    $request .= "User-Agent: Its me again\r\n";
    $request .= "Content-Length: ".strlen($postdata)."\r\n";
    $request .= "Content-Type: application/x-www-form-urlencoded\r\n";
    $request .= "\r\n";
    $request .= "$postdata\r\n";
    
    fwrite($f, $request);
    $response = '';
    while (!feof($f)) 
    {
           $response .= fgets($f, 128);
    }

    $pos1 = strpos ( $response , '</from>');

    $pos2 = strpos ( $response , '<br><br><img' , $pos1 );

    $parse_from = substr( $response, $pos1+21, ($pos2-$pos1) );
    $pattern = "/<b>([^\/]*)<\/b>/si";
    preg_match_all($pattern, $parse_from, $matches);

    return $matches[1][1];
}

echo (get_country($ip));
 ?>
Ruturaj's Home Page
 
Not SOAP
Posted by Daath on Sat, 01/15/2005 - 14:13.
This has nothing at all to do with SOAP ;)

-
Any technology distinguishable from magic, is insufficiently advanced.
So gut
Posted by Jomas56 on Sat, 05/05/2007 - 01:07.
This strange, I think: teens butt Them big teens butt. anal cum movies Watch anal cum movies now. mature asshole Her mature asshole is very attractive. teen anal pain Is teen anal pain pleasure? lesbian fuck machines They found lesbian fuck machines here. gay toying Gay toying? You said? fetish pee Hotel named: " fetish pee " asian wife black Asian wife black, isn't it? big boob sluts There are few pretty big boob sluts. fet hentai My hobby is fet hentai. gay machine fucking There are gay machine fucking in the room. lesbian banana It was lesbian banana sex. mature at beach ' Mature at beach ', exactly! big brunette tits Her big brunette tits are the great. asia ass fucked It is asia ass fucked girl. anal herself Dan want anal herself now. Really, strange.