Forum Moderators: coopster

Message Too Old, No Replies

How to show IP address

         

nevdev

1:56 pm on Jul 6, 2005 (gmt 0)

10+ Year Member



I put the following lines into my php page:

Full path:<br><?php echo "$SERVER_NAME$PHP_SELF"?><br>IP Address:<br><?php echo "$REMOTE_HOST"?><br>

The path shows, but the IP address doesn't. Anyone know why?

nevdev

2:01 pm on Jul 6, 2005 (gmt 0)

10+ Year Member



I substituted REMOTE_ADDR and it works. I got the variable wrong.?

gliff

2:08 pm on Jul 6, 2005 (gmt 0)

10+ Year Member



Try

print_r($_SERVER);

next time you're stuck

coopster

6:23 pm on Jul 6, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Looks like you are also running with register_globals On. You'll want to read up a bit on that, nevdev.

Using Register Globals [php.net]