Page 1 of 1

Capturing User Date

Posted: Tue Feb 10, 2009 4:40 pm
by spacebiscuit
Hi,

I would ike to gather as much user data as possible from users of my site. I know for example that I can capture their IP address, but what other data is available.

Many thanks,

Rob.

Re: Capturing User Date

Posted: Tue Feb 10, 2009 4:50 pm
by VladSun
You may capture all of the data available to javascript objects (especially the window object)

Re: Capturing User Date

Posted: Tue Feb 10, 2009 5:17 pm
by Mark Baker
robburne wrote:what other data is available.
Take a look at browserspyif you want to see just how much information can be gathered

Re: Capturing User Date

Posted: Tue Feb 10, 2009 5:48 pm
by spacebiscuit
Many thanks, it does not show how this data can be retrieved though.

I am looking for php specifically.

Thanks,

Rob.

Re: Capturing User Date

Posted: Tue Feb 10, 2009 5:51 pm
by John Cartwright
You could send an ajax request to the server with the relevant javascript information.

Re: Capturing User Date

Posted: Tue Feb 10, 2009 6:04 pm
by Attero
To grab the users local time, it's best to use Ajax and send the time from JavaScript to PHP.
Don't keep doing this as it will just be too intensive to handle, so when sending it to PHP, work the difference out between the users time and the servers time and store that.
Then whenever you want to show them their time, simply use a method to add/takeaway the difference (which should be stored in DB).

This means that JavaScript will only be used once per user and will mainly be all PHP based. :)


Also have a look at using get_browser() with the php_browscap.ini file which you can search on google. It's very helpful and will tell you all sorts of things like which browser and version is being used, what operating system is being ran, etc. But beware, the loading times for this function is getting longer and longer as browsers are being updated all the time.

Re: Capturing User Date

Posted: Tue Feb 10, 2009 6:10 pm
by VladSun
If it's only data collecting (i.e. no reply action) you may use simple javascript like this:
[js]var message = 'message to send'; var img = new Image();img.src='http://mysite.com/collector.php?msg=' + message;[/js]

No AJAX used

You may even put

Code: Select all

<noscript><img src='http://mysite.com/collector.php?js=no' style='display:none;'></noscript>

Re: Capturing User Date

Posted: Tue Feb 10, 2009 6:19 pm
by spacebiscuit
Thanks I will give it a go.

Rob.