Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get all client info from website visitors?

Tags:

networking

I want to collect all the information that we could when someone is visiting a webpage: e.g.:

clients screen resolution: <script type='text/javascript'>document.write(screen.width+'x'+screen.height); </script>
referer: <?php print ($_SERVER['HTTP_REFERER']); ?>
client ip: <?php print ($_SERVER['REMOTE_ADDR']); ?>
user agent:  <?php print ($_SERVER['HTTP_USER_AGENT']); ?>

what else is there?

like image 273
LanceBaynes Avatar asked May 25 '11 19:05

LanceBaynes


2 Answers

Those are the basic pieces of information. Anything beyond that could be viewed as SpyWare-like and privacy advocates will [justifiably] frown upon it.

The best way to obtain more information from your users is to ask them, make the fields optional, and inform your user of exactly what you will be using the information for. Will you be mailing them a newsletter?

If you plan to eMail them, then you MUST use the "confirmed opt-in" approach -- get their consent (by having them respond to an eMail, keyed with a special-secret-unique number, confirming that they are granting permission for you to send them that newsletter or whatever notifications you plan to send to them) first.

As long as you're up-front about how you plan to use the information, and give the users options to decide how you can use it (these options should all be "you do NOT have permission" by default), you're likely to get more users who are willing to trust you and provide you with better quality information. For those who don't wish to reveal any personal information about themselves, don't waste your time trying to get it because many of them take steps to prevent that and hide anyway (and that is their right).

like image 144
Pascal Cuoq Avatar answered Sep 24 '22 05:09

Pascal Cuoq


Get all the information of client's machine with this small PHP:

<?php
foreach($_SERVER as $key => $value){
echo '$_SERVER["'.$key.'"] = '.$value."<br />";
}
?>
like image 38
Technolust Avatar answered Sep 21 '22 05:09

Technolust