Home
Articles
Forums
Resources
Downloads
Search
Last Visit
IP To Country
Get Album Art
Embed Codes
Music Playlists
Music Search
Member Links
Photo Gallery
Support The Cause
Who's Online

Converting IP addresses on the fly one IP or a dozen. Nice!



News: August 28, 2008, 11:56:44 AM
Welcome, Guest. Please login or register.
Did you miss your activation email?
*

Converting IP addresses on the fly one IP or a dozen. Nice!
Pages: [1]
  Print  

  Converting IP addresses on the fly one IP or a dozen. Nice!
Author Message
Website Manager
Administrator
Newbie
*****
Offline Offline

Posts: 21



« on: January 06, 2008, 10:59:09 PM »

I have included the option with IP To Country to convert single or multiple IP addresses on the fly .  Grin

For example, if you want to display a webpage visitor's flag icon beside his username, you can use IP To Country in an image tag along with the visitor's IP address to make it easy.
Here's an example:
Code:
<img src="http://jasonlau.biz/ip2country/flag/{IP HERE}">
The PHP code would look like this:
Code:
echo "<img src=\"http://jasonlau.biz/ip2country/flag/" . $_SERVER['REMOTE_ADDR'] . "\">\n";

There are several modes to choose from and the mode is easily changed in the URL address for IP To Country.
Example: http://jasonlau.biz/ip2country/{MODE HERE}/{IP HERE}

The modes are as follows:
xml - Generates xml 1.0 file containing all of the following data.
rss - Generates rss 2.0 file containing all of the following data.

ipv4 - Generates an IPv4 Internet network address.
cc1 - Country Code 1 Example: US
cc2 - Country Code 2 Example: USA
cn1 - Country Name 1 Example: UNITED STATES
cn2 - Country Name 2 Example: united states
cn3 - Country Name 3 Example: United States
flag - Generates flag icon for that country

You can also make direct requests by using your browser and entering the following URL into the browser's address bar:
http://jasonlau.biz/ip2country/{MODE HERE}/{IP HERE}

IP To Country will also accept a comma separated list of IP addresses and will return a comma separated list of results.
Example: http://jasonlau.biz/ip2country/{MODE HERE}/{IP HERE},{IP HERE},{IP HERE}

 Cheesy
« Last Edit: January 08, 2008, 02:14:12 PM by Website Manager » Logged

Pages: [1]
  Print  
 

Jump to: