
May 11th, 2002, 10:02 PM
|
|
|
Join Date: Apr 2002
Location: Sydney, Australia
Posts: 588
Time spent in forums: < 1 sec
Reputation Power: 17
|
|
Yep, there is,but why would you want to record a users IP to a session variable? Anyhow, it's available in the $HTTP_SERVER_VARS array, or $_SERVER, depending on which version of PHP you have.
It is $HTTP_SERVER_VARS["REMOTE_ADDR"] or $_SERVER["REMOTE_ADDR"]
Use this loop to see all server vars:
foreach($_SERVER as $key => $val)
echo "$key = $val<br>";
You would of course use session_register("ip", $HTTP_SERVER_VARS["REMOTE_ADDR"]); to set the session value.
|