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.
Capturing User Date
Moderator: General Moderators
Re: Capturing User Date
You may capture all of the data available to javascript objects (especially the window object)
There are 10 types of people in this world, those who understand binary and those who don't
-
Mark Baker
- Forum Regular
- Posts: 710
- Joined: Thu Oct 30, 2008 6:24 pm
Re: Capturing User Date
Take a look at browserspyif you want to see just how much information can be gatheredrobburne wrote:what other data is available.
-
spacebiscuit
- Forum Contributor
- Posts: 390
- Joined: Mon Mar 07, 2005 3:20 pm
Re: Capturing User Date
Many thanks, it does not show how this data can be retrieved though.
I am looking for php specifically.
Thanks,
Rob.
I am looking for php specifically.
Thanks,
Rob.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: Capturing User Date
You could send an ajax request to the server with the relevant javascript information.
Re: Capturing User Date
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.
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
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
[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>There are 10 types of people in this world, those who understand binary and those who don't
-
spacebiscuit
- Forum Contributor
- Posts: 390
- Joined: Mon Mar 07, 2005 3:20 pm
Re: Capturing User Date
Thanks I will give it a go.
Rob.
Rob.