title: Track users with PHP and JavaScript
body: <p>Have I missed any obvious things that you can log to keep track on your visitors (using PHP and JavaScript)?</p>
  
  <ul>
  <li>Can I get computer name?</li>
  <li>Can I get the country?</li>
  <li>Can I get the city?</li>
  <li>Postal code?</li>
  <li>Any other information that can be collected from certain browsers?</li>
  </ul>
  
  <p><strong>PHP DOCUMENT :</strong></p>
  
  <pre><code>&lt;script&gt;
  
  &lt;?php 
  $ip = $_SERVER['REMOTE_ADDR'];
  $hostaddress = gethostbyaddr($ip);?&gt;
  &lt;?php echo "document.write('The IP-adress: ' + " . "'" . $ip . "'" . " + '&lt;br&gt;');";?&gt;
  &lt;?php echo "document.write('The host address: ' + " . "'" . $hostaddress . "'" . " + '&lt;br&gt;');";?&gt;
  
  document.write('The date: ' + new Date() + '&lt;br&gt;');
  document.write('Get the entire URL of the current page: ' + location.href + '&lt;br&gt;');
  document.write('This document was last modified on:' + document.lastModified + '&lt;br&gt;'); // good to know wich version of the page they have
  
  if (document.referrer != ''){
  document.write('The referrer of this document is: ' + document.referrer + '&lt;br&gt;')
  }
  else{
  document.write('The is no referrer.&lt;br&gt;')
  }
  
  document.write('Number of URLs in history list: ' + history.length + '&lt;br&gt;')
  
  // I know it doesn't allways return the right browser info, but it gives a good clue.
  document.write("Browser name: " + navigator.appName + '&lt;br&gt;');
  document.write("Browser version info: " + navigator.appVersion + '&lt;br&gt;');
  document.write("Platform: " + navigator.platform + '&lt;br&gt;');
  document.write("User-agent header sent: " + navigator.userAgent + '&lt;br&gt;');
  document.write("Language of user: " + navigator.userLanguage);
  
  document.write("Total Height: " + screen.height + '&lt;br&gt;');
  document.write("Total Width: " + screen.width + '&lt;br&gt;');
  
  document.write("Cookie: " + document.cookie + '&lt;br&gt;');
  
  &lt;/script&gt;
  </code></pre>