Could any body point me in the right direction of a tutorial on using strings to auto fill a form?

I'll give you an example of what I want: A person clicks on a button that carries specific information associated with that button in the address bar, and the button takes them to another page containing a form. The form gathers the information in the address bar and uses it to fill a text field that will later be used to identify the form in an e-mail. Upon submitting the form it will create a xml file attached to an e-mail sent to me.