ip
Does An IP Address Provide Useful Tracking Information?
Tue, 01/18/2011 - 23:37 | by philipnorton42An IP address is an address for a computer on the Internet. The usual example used is of a web server that can be accessed via a URL that is translated behind the scenes into an IP address, but IP addresses can be used to find any computer on the Internet.
PHP IP To Location
Mon, 03/01/2010 - 23:22 | by philipnorton42Converting an IP address into some useful location information can be useful if you want to find out where sites are hosted or customise content to users depending on their location.
All this code is freely available over at github.
There are several ways to do this, all of which have their advantages and disadvantages, but sticking with one can cause rewriting a lot of code in the future. So rather than pick one and stick with it I decided to use dependency injection to allow different classes to be used that convert IP addresses to locations in different ways. The first task is to create an abstract class that will be used to construct the rest of the IP location classes. Each class that extends this abstract class will contain a method called getIpLocation() that will convert an IP address into a location, and a method that will update the data source for the location lookup. Rather than lump all of the classes into a single directory I have created a directory called Service, into which all of the different classes that lookup IP addresses will be kept.
Set An IP Address From The Command Prompt In Windows
Wed, 11/19/2008 - 11:03 | by philipnorton42Rather than use the old connection properties dialog in Windows you can open up a command prompt and use the netsh to set up all sorts of network specific settings. The most useful part of this is that you can create a bat file that will allow you to quickly change your local IP address very quickly.
To see a list of the network connections available you can use the following command.
Get The IP Address Of A Visitor Through PHP
Wed, 11/12/2008 - 10:58 | by philipnorton42I have talked previously about getting an IP address of a visitor with PHP. The failing in using the value of $_SERVER['REMOTE_ADDR'] is that if the visitor is using a proxy then you will get the proxy IP address and not the visitors real IP address.
Blocking Multiple IP Addresses With PHP
Tue, 05/20/2008 - 08:32 | by philipnorton42It is sometimes necessary to block people from using your site, dependent on their IP address. A users IP address can be detected by PHP using the $_SERVER superglobal and the parameter REMOTE_ADDR.