Hi, I'm trying to record a users IP address in their profile everytime they visit, but its not working.
Essentially, If I change the variable containing the IP address it WORKS, otherwise, it just has no change at all.
heres the code:
$userip=$HTTP_SERVER_VARS["REMOTE_ADDR"];
mysql_query("UPDATE users SET lastip=$userip WHERE id = '$sessionid'");
So if I replace the "$userip" portion, it works just fine.
But when I echo the $userip, it does in fact contain the IP address.
Oh, and when I INSERT the info, it works as well. Weird huh...
Anyone got any info I could use?? 🙂
Thanks!