Currently, I am using this:
<A href="/?id=page_name2&referrer=<?php echo $_GET['id']; ?>">Page Name 2</A>
Which displays the URL like this:
www.domain.com/?id=page_name2&referrer=page_name
I want to store the referring data to a TXT file, which will be in a folder on a server. I do not want to use Google Analytics nor any SQL.