Page 1 of 1
Hit Counter
Posted: Mon May 17, 2004 5:23 pm
by snpo123
Okay, so....
I want to make a PHP script that gets the IP address of the person viewing the site and stores it in a database. Do I need to Install an extra plug-in?
Thanks very much.
Posted: Mon May 17, 2004 6:00 pm
by dull1554
nope
Code: Select all
$_SERVER['REMOTE_ADDR'];//will return the ip of the person viewing the page
good luck
Posted: Mon May 17, 2004 6:44 pm
by HaVoC
I find this one works better
Posted: Mon May 17, 2004 7:43 pm
by tim
they both will work
as for performance wise, I didnt see a difference in either or
I use $_SERVER['REMOTE_ADDR']; myself
Posted: Mon May 17, 2004 7:46 pm
by dull1554
i got curious and i checked execution time for both of them....
gosh i have too much time....
on my local server $_SERVER['REMOTE_ADDR'] was 0.00008 seconds slower then getenv()
do with this what you may....
Posted: Mon May 17, 2004 7:55 pm
by tim
lol, what possible can you do in 0.00008 seconds ?
can u even blink that quick, $_SERVER['REMOTE_ADDR'] is faster to type n looks better
in my opinion, of course.

Posted: Mon May 17, 2004 7:56 pm
by dull1554
thats what i was getting at....who gives a damn?!?!?
Posted: Mon May 17, 2004 8:47 pm
by snpo123
thanks for the help, ill choose which one to use later!