0

I'm creating a homepage where I want to keep an open comment field. But in the case that this is abused I want to log as much client information as possible on all the users that makes a post.

So my question is, how can I get the maximum amount of user data from a user with javascript?

In php I can save the $_SERVER variable but is there any similar easy way of doing it in Javascript? Also if not what data would you recommend to save? Ip, geodata, maybe a username? I don't know how powerful javascript is in getting user system information.

gen_Eric
  • 223,194
  • 41
  • 299
  • 337
Sun_Blood
  • 335
  • 2
  • 5
  • 12
  • You cannot retrieve an IP using just JavaScript. There is no x-browser way to retrieve usernames (you can do this in IE using ActiveX). Geo data will not be accurate enough to pinpoint a particular user (and is not x-browser either). Your best bets will be setting a cookie (which of course can be deleted), and combining IP (which can change of course) with stuff like user agent (but don't forget they can just switch browsers). Basically, you're going to struggle. Look at a service like Askimet which filters spam, or captchas/ requiring auth. – Matt Mar 01 '13 at 21:00
  • Pretty sure JavaScript (alone) can't get the user's IP. – gen_Eric Mar 01 '13 at 21:00
  • Anybody intent on abusing your comment page is likely to be willing and able to disable the JavaScript. – Pointy Mar 01 '13 at 21:09
  • I know that all attempts to log user data can be bypassed. But this together with a good legal "terms of use" should keep me as the owner of the site out of possible legal problems from bad user activity. – Sun_Blood Mar 01 '13 at 21:13

0 Answers0