Passing information from a Dynamic Page to a form

I have a referral page on my site that is dynamically generated. On it, customers can put in information to refer a friend to a given representative.
The form is dumped into a database and I need to know what representative is being referred to.
Ideally, I want to do the processing on the backend, that way nobody can mess with a form field or something. But if front-end JS is the only way to do it, then please let me know how I can get that information.

What is the best way to accomplish knowing what representative should get the referral?

Thanks.