I can understand why your doing what your doing. Belt and suspenders.
I go with my first suggestions. Create your link to open call you server side script to a pop up that is way off of the screen. Then your serverside script can run just fine.
In you pop up script be sure to check that the window does actually open, cause of pop up blockers. And once it is open you can just close it as well.
Tj