I want to record the users ip address so I can customize content according to what they selected last time..etc, what is the best way to do this? Ive tried $_SESSION['REMOTE_ADDR'] but that seems to return NULL...what is the best way to do this?

Comments

'REMOTE_ADDR' is not saved in

'REMOTE_ADDR' is not saved in the $_SESSION array.
It's: $_SERVER['REMOTE_ADDR'];

Anyway, I don't think this is the right attempt to reach your target.
Maybe you can be more precise in what you want to do?

Thanks!

I am already allowing users to create usernames and log in if they want to, but for visitors who just visit a couple of times or still cant be bothered registering, i want to be able to change some of the content of the site based on whatever will uniquely identify them when they visit the site, and as far as Im aware unless they create a user/login it would have to be the ip address (?)

Ah, okay, a very typical

Ah, okay, a very typical privacy problem.

But you should not rely on the IP addess because there are many people having a dynamic IP address, that means that they get a new one every night. If you want to do it anyway you should use _SESSION, but this will be lost if the user deletes his cookies.

I would really not recommend you to try identify guests as users and give them any permissions, that usually users have.

Note, IP is not necessarily

Note, IP is not necessarily going to be unique, since more than one person can using the same ip. I would make customization of benefit of joining.

nobody click here