Redirect/Close Popup Window

I am trying to do two things. I have PDF files but the user has to click on the icon and a contact form will come up in a pop-up window. That window has a form and once the form is completed and properly validated, I want the pop-up window to automatically close and go to “”. It will do everything but it only goes to How can I get it to go to the entire URL including “?download=1”? The link is

By specifying the entire URL as the action attribute of the form.

That won’t work on my part. I have the form that I am using to collect information in a popup window. What I want to do is, once all information entered is correct, is to close the popup window and go back to the original page with the “white_papers.php?download=1”. Putting this as an action in the form tag will load that page in the popup window. I want the popup window to close and then use the URL above redirected.

Here is more detail. When all data is validated and everything is don in the popup window, I use the code :
echo (“<SCRIPT LANGUAGE=‘JavaScript’> window.location.href=‘white_papers.php?download=1’; window.close(); </SCRIPT>”);
The popup window closes but window.location.href does not execute.
If I remove window.close(), that line works but the popup window does not close and the file loads in the popup window. How do I fix this?

Typically the child window is not allowed to make changes to the parent.

What can be done though is for the child to execute a script that exists in the parent.
Have a function in the parent that changes the location. Then from the child, have it call that parent function just before the child closes itself.

Can you give me some example files doing this?

Here are some examples:

So if your parent window had a function called afterChildSubmit() your child window could call that parent function and then close the child with: