Skip to content Skip to sidebar Skip to footer

Live Who Is Online On Website

i have a small script who show me who is online o website but in db is stored by ip2long and i want to stored the real ip adress of user ....please can sombody can help me with thi

Solution 1:

IP addresses should be stored as the result of the ip2long function. You can then use the long2ip function to convert the integer to a dot-notation IP address when you fetch the result from the database.

Preparing an IP address to be inserted from the database:

$ip = ip2long($_SERVER['REMOTE_ADDR']);

Taking a database from the database and returning it in the dotted-notation format:

$ip = long2ip($row['ip_address']);

Simples.


Post a Comment for "Live Who Is Online On Website"