So I’m using <input type="hidden" value="<?php echo $_SERVER['HTTP_REFERER'] ?>" name="Referer" /> in a form to log what page the form was submitted on. This works fine, but is there a way I can retrieve the originating external address as well?
As an example, if the user were to come from Facebook and then submit the form then HTTP_REFERER would show Facebook - great! But if the user were to come from Facebook, then browse a few pages on my site, and then submit the form, then the HTTP_REFERER would show the last page visited (an internal page) not the originating one.