How do I get the IP addresses of the visitors?

hello webmasters

How do I get the IP address of the visitors who are coming to my website.

thanks in advance


You’ll need to look at the site logs on the server.
Why does it matter?

What server-side lanaguage is in use? eg php, asp, .net etc

Site logs, or just put on your site

StatCounter is good analytics tool, you can see visitors ip address on it.

Whats the matter with the ip address. Knowing the region is more than enough for a good webmaster rather than viewing individual ip address. Few service providers keep on change their ip’s. Try using Google Analytics. It will help you.

You need to write a php script to detect the IP address and obtain the ISP from that. Then you need your own ip-to-country database on your own site and look up the ip there and build your message accordingly. There are some free ip-to-country databases on the net that you can download data from and maintain your own database with that data. No such free ones for more detailed geo-location data though.

use it helps to know the ip address,country name ,visited date ,visited URL and etc…

Register to, install the script then go to Recent Pageload Activity it will show you detailed reports of the visits including each visit ip.
Personally I find StatCounter much better then GA, or I just got used with it.

i want to use it for blogger blog


Sorry Kalon but where is the $ standing for? Is it not just CGI.REMOTE_ADDR

$_SERVER is the array name.

if you haven’t already clicked the link to the php manual’s explanation, click it and hopefully all will be explained…

Use $_SERVER[‘REMOTE_ADDR’] to log into a text file.

Yeah I know it is like that for PHP :slight_smile: But do we know if that is the program in use, since I haven’t seen an answer as yet to SpacePhoenix’ question

What server-side lanaguage is in use? eg php, asp, .net etc

since the OP put the request in the PHP forum I think it’s safe to assume he/she is looking for a PHP solution unless they state differently in which case their request should not be in this thread.

actually, the thread started off, if you can believe it, in the Search Engine Optimization forum, and was moved to the php forum only because of the direction the thread was taking…

My question was before it was moved, so let’s move on :slight_smile:

ok, I didn’t realise it was moved.

if you google “blogger blog” and find out whatever that is, it might tell you what language is being used.

I obviously did that, but like many other sites do to my annoyance, the tour was in the language based on my IP location, which is Greek