|
-
Nov 26th, 2003, 10:49 PM
#1
Thread Starter
Lively Member
IP Address
I'm wanting to record the person's IP Address when they register an account on my database (php/mysql). How can I get the users IP Address?
-
Nov 27th, 2003, 04:07 AM
#2
Lively Member
$Hostname = @gethostbyaddr($REMOTE_ADDR);
http://www.raketje.com coming..............soon................
-
Nov 27th, 2003, 04:13 AM
#3
Thread Starter
Lively Member
Thanks. How about the others? This returns blanks.
Code:
$RemoteAddress = @gethostbyaddr($REMOTE_ADDR);
$RemoteHost = @gethostbyaddr($REMOTE_HOST);
$RemoteUser = @gethostbyaddr($REMOTE_USER);
$UserAgent = @gethostbyaddr($HTTP_USER_AGENT);
echo $Hostname;
echo "<br>";
echo $RemoteHost;
echo "<br>";
echo $RemoteUser;
echo "<br>";
echo $UserAgent;
echo "<br>";
-
Nov 27th, 2003, 11:23 AM
#4
Try
PHP Code:
echo $RemoteAddress = getenv("REMOTE_ADDR") . "<br>" .
$RemoteHost = getenv("REMOTE_HOST") . "<br>" .
$RemoteUser = getenv("REMOTE_USER") . "<br>" .
$UserAgent = getenv("HTTP_USER_AGENT") . "<br>";
http://www.complex-sys.com/getenv.php
If some of them don't return, it's because of your server software. The REMOTE_USER does not return on my IIS server.
-
Nov 27th, 2003, 12:02 PM
#5
Stuck in the 80s
Originally posted by bekkel
$Hostname = @gethostbyaddr($REMOTE_ADDR);
$REMOTE_ADDR is deprecated. Use $_SERVER['REMOTE_ADDR'].
-
Nov 27th, 2003, 02:23 PM
#6
Thread Starter
Lively Member
Thanks guys
-
Dec 3rd, 2003, 10:54 PM
#7
Frenzied Member
not a sure fire way to get it. they can still be blank whateve way you do it. they can be behind a proxy or they can edit it so they don't show it. a lot of things.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|