In PHP I see that
$_SERVER['HTTP_REFERER']
gives me the refering url if the refering page had a link that was clicked through to my current page. But what if page A has a htaccess redirect that sends the user to page B. If I have the above snippet on Page B will I get Page A as the referer?
Or does it only work if a user clicks on a link that takes them to page B?
To begin with: http://php.net/manual/en/reserved.variables.server.php
To answer your question:
Page A will be sent if it is silent rewrite (temporary redirect).
Page B will be sent if it is a redirect that sends a 301 (permanent redirect).