Jump to content
moubik

ip2country php script

Recommended Posts

am facut un mic script ce cauta intr-o baza de date un ip si-ti da tara caruia apartine.

se poate folosi

http://localhost/ip2location.php - pt propriul ip

http://localhost/ip2location.php?ip=123.123.123.123 pt ip-ul specificat.

am inclus:

- fisierul cvs din care am creat tabela cu informatii

- splitterul care populeaza tabela

- ip2location.php

- baza de date in format sql

si formatul tabelei:

CREATE TABLE IF NOT EXISTS `lists` (
`id` bigint(20) NOT NULL auto_increment,
`ipstart1` int(3) NOT NULL,
`ipstart2` int(3) NOT NULL,
`ipstart3` int(3) NOT NULL,
`ipstart4` int(3) NOT NULL,
`ipend1` int(3) NOT NULL,
`ipend2` int(3) NOT NULL,
`ipend3` int(3) NOT NULL,
`ipend4` int(3) NOT NULL,
`u1` varchar(30) NOT NULL,
`u2` varchar(30) NOT NULL,
`countryshort` varchar(2) NOT NULL,
`countrylong` varchar(40) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

http://websecurity.ro/blog/wp-content/uploads/2007/11/ip2country.zip

Link to comment
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.

Guest
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...