The following PHP code shows the referrer, if it exists:
<?php $ref = $_SERVER['HTTP_REFERER']; ?> <!DOCTYPE html> <body> <?php echo $ref; ?> </body> </html>
To check the referrer, you must use another file that links to it, which in this case sits in the same directory.
<!DOCTYPE html> <body> <a href="examplereferrer.php">Click ME!</a> </body> </html>
You can apply the same principle to any language, as this is provided by the HTTP specification. As long as the client sends you this information, you can use. Remember it is optional, so you may end up with an empty variable.