Despite all downfalls of using IP addresses,
if you are in North America most people
in a University or business environment use
a fast connection (DSL or Cable) you may
choose to use the following chunk of code to
retrieve someone's IP number

if (getenv(HTTP_X_FORWARDED_FOR)){
 else {
  $someones = getenv(REMOTE_ADDR);
// From Klemens Karssen's code from

Alternatively use Cookies which are easy to
use (check the cookie function on
Cookies and Sessions from my understanding
of earlier discussions in this forum might be a
wiser idea...


"Sebastian Marcu" <[EMAIL PROTECTED]> wrote in message
> Hi there,
> I am new to PHP and need some help.
> I was wondering if there is a way to get hold of the IP address of a site
> visitor with PHP. I'm trying to develop an interaction where the server
> would recognise a new visitor from a returning visitor via the IP address.
> Regards,
> Sebastian

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to