<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1034860" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1034860</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/iptocountry-converter-php-script#comment-1202366</link>
    <description> &lt;p&gt;What about just calling &lt;strong&gt;whois &lt;em&gt;{ip address}&lt;/em&gt;&lt;/strong&gt; from PHP and grabbing the country code. &lt;/p&gt;
&lt;p&gt;At least on my server, when I do a &lt;strong&gt;whois 130.101.206.49&lt;/strong&gt;, I get the following (I just posted the first section)&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;OrgName:&amp;nbsp;&amp;nbsp;&amp;nbsp; University of Akron&lt;br /&gt;OrgID:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNIVER-97&lt;br /&gt;Address:&amp;nbsp;&amp;nbsp;&amp;nbsp; Computer Center&lt;br /&gt;Address:&amp;nbsp;&amp;nbsp;&amp;nbsp; 185 Carroll St&lt;br /&gt;City:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Akron&lt;br /&gt;StateProv:&amp;nbsp; OH&lt;br /&gt;PostalCode: 44325-3501&lt;br /&gt;Country:&amp;nbsp;&amp;nbsp;&amp;nbsp; US&lt;/code&gt;&lt;/div&gt;&#039;&lt;br /&gt;
All the tests I just did came back with this format, so I should be able to just go grab the line that starts with COUNTRY:&lt;/p&gt;
&lt;p&gt;If you need help on how to do this, let me know.&lt;/p&gt;
&lt;p&gt;-Greg&lt;/p&gt;
 </description>
     <pubDate>Sat, 17 Jun 2006 07:16:38 +0000</pubDate>
 <dc:creator>Greg K</dc:creator>
 <guid isPermaLink="false">comment 1202366 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
