The Forms module doesn't have a built-in way of passing/receiving data like this (other than by custom code).
Off the top of my head, an out-of-the-box method (somewhat cumbersome, but still) could be by using a combination of Visitor Groups and the Hidden Profiling form field type.
You could create a Visitor Group that captures which page (or category) the visitor was on before going to the contact page.
In your form, you can use the Hidden Profiling form field type to retrieve which Visitor Group the visitor was in (and hence, which page they came from).
This probably isn't a very manageable solution in the long run (considering you may have many pages that send visitors to the contact page).
Best or recommended method - definitely not ;-)
Another approach
Regards
/K
Thanks for the suggestions! Im going with overriding the hidden form field so it can grab necesary data. Just working through an anti-forgery token issue at the moment.
Im looking to create a setup where a user views some program information, and after clicking a "request more info" button, it sends them (and some info on where they came from) to a contact page. Is this possible using the out of box Forms? Or is this something better created from scratch? Any ideas would be appreciated!