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)){
   $ip=getenv(HTTP_X_FORWARDED_FOR);
 }
 else {
  $someones = getenv(REMOTE_ADDR);
 }
// From Klemens Karssen's code from www.php.net

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

Spike..


"Sebastian Marcu" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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 (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to