Well, first, PHP is SERVER-SIDE only. It runs on the server, not in the browser. Therefore, if you want to let
the user open the PDF, you need to use a CLIENT-SIDE program code to execute it. You can do that with
either Javascript, JQuery or HTML. NOT with PHP. It can be done with PHP by setting up a Javascript to run
ONLOAD when the page is loaded into the browser, but, that gets tricky and does not always work as it really
should.
One easy way to handle this using your select clause code is to set up a JS or in this example a JQuery code
function to pop out your extra page whenever the drop-down’s option is selected. Here is a sampler of how
it would work. You should place the JQ code at the bottom of the page so it is after the select is totally
populated. For some reason that seems to work better on some systems and certain browsers…
Also, to allow the secondary page, you need to place the full URL for the PDF file. So, you have to
alter your option to fit it in. Something like:
[php] echo “”.$filename."";[/php]
Then, the JQuery would be something like:
[php]
[/php]
Remember, if the URL is not set up as a valid one, it will cause odd errors. If the PDF is to be displayed in
a new window, it is just as if you typed that URL in. Should work for you! Good luck!