$ip = $HTTP_SERVER_VARS["REMOTE_ADDR"]
or simply $REMOTE_ADDR
try putting
phpinfo();
in your code somewhere (just long enough to view the information)
try to set a cookie for each guest that comes in. Keep in mind that quite a few people turn cookies off.
Keep in mind that if the guest is using a dialup connection their ip address will be different every time the visit your site.
you should use php sessions to track the user as they navigate during their visit. (Don't forget to code for those who have cookies turned off)
Rulian wrote:
I'm trying to log my users in time tables, my site consists of members and guests, I can log the members fine because they each have individual usernames, but guests are tricky, because they're nothign to tell the difference between a new guest, or a guest entering different pages. I'm looking for a way to get an IP address, or maybe a session id that will be unique to each guest. any ideas? I've seen sites where they log ips, but I can figure out how that works because the only ip functions I've seen require a host name, so where do I get the host name from?