I just looked into it. You can NOT use either of these ways. I will explain.
Normally, you use POST. Normally, you post to the same page. If you post to another page, you pass parameters using SESSIONS or post thru the URLās. Since you are using formās, you would normally just place the code and processing for the form all in that one page.
Since you have only the entry of a reference number, there is no reason to use a second page. Do you have a special reason to use a second page? Here is the layout of the two ways possible.
First, put all the code into one page. The user enters a ref-code and presses save-pdf or view-pdf.
This would call itself to run all the PDF codes. If done this way, you would use POST only.
Second, use the first page to enter the ref-code and a second one to process it. This way requires the
creation of a URL which would contain the data needed to pass onto the second page. Then, it would
redirect to the second page. The second page would GET the data since it is already inside the URL.
Then, it would process the PDF code.
There is a third way actually that saves the data inside a SESSION variable. This is fairly easy as you would just pass the ref-code in the session variables. But, for testing the first or second version would work.
Now, did you understand that? Pick which way you want to process and I will help you with the code.
As-is now, we would have to rewrite how the ref-code is sent to the second page. Not hard to do.