Originally Posted by
GAMEchief Most sites (and all forums) already have this built in. It's pretty useless if you're not telling where they are or what they were doing. You just know they visited - some anonymous user did something, anything. It's useless for large sites, not to mention the huge toll this would take after a million visitors. Your log file would enter the gigabytes - as if you'd read it all to figure out who did what.
It's a good start to introduce webmasters to REMOTE_ADDR (don't forget X_FORWARDED_FOR), but this specific code shouldn't be used. If it's the only PHP on your site, you don't have a reason to log visitors - no one is going to exploit your HTML. And if you are using something exploitable, you're better off making such logs in user accounts or other databases/tables.