Show user information such as IP address and their browser

Posted 2 years ago

Showing users information is particularly easy, below is a list of useful information you can return such as the page the user was previously on before landing on this page.


<?php
  echo "Browser: " . $_SERVER['HTTP_USER_AGENT'] . "
"; echo "Requested URL: " . $_SERVER['REQUEST_URI'] . "
"; echo "Where you come from: " . $_SERVER['HTTP_REFERER'] . "
"; echo "IP: " . $_SERVER['REMOTE_ADDR'] . "
"; echo "Time of request: " . $_SERVER['REQUEST_TIME'] . "
"; echo "Your chosen language: " . $_SERVER['HTTP_ACCEPT_LANGUAGE'] . "
"; ?>

<?php
  echo '<pre>';
  var_dump($_SERVER);
?>