The pageA.php is the parent page, pageB.php is the popup window which will display after clicking link on the parent page (i.e. pageA.php).

I would like to close the popup window after clicking submit button on the popup window and the form on the parent page is also submitted at the same time.

The code at below isn't submitting the form on the parent page:

```
if (isset($_POST['submit'])) {

     echo "<script type='text/javascript'>
                        window.close();
                        opener.location.formName.submit();
         </script>";

}

```

Is there anyone can help me out?