In which variable is the users IP address stored?

Options
- $DOMAIN
- $REMOTE_ADDR
- $GLOBALS
- $_ENV


CORRECT ANSWER : $REMOTE_ADDR

Discussion Board
Old Answer

The answer is valid for old default config
The new default config you need $_SERVER['REMOTE_ADDR']

JB 04-21-2017 11:41 AM

IP address stored

Answer : $REMOTE_ADDR.

PHP has in built facility to detect remote browser, IP address, and other properties. These values are assigned to special variable.
In this case, it is assigned to a variable called $REMOTE_ADDR.

Syntax:
$ip= $REMOTE_ADDR;

IamJay 02-9-2015 06:17 AM

wft

There is no predefined variable:
$REMOTE_ADDR
you may think : $_SERVER['REMOTE_ADDR'] ????

Szabi 01-21-2014 11:56 AM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement