|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
About Sessions?
using sessions is there a way where i can record ip's using a session? if so how do i write this in my code?
![]()
__________________
Apache Expert |
|
#2
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > About Sessions? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|