Huster Huster - 1 year ago 89
PHP Question

php using header to Redirect

I m new on php stuff so execuse me for any confusing terms.
I have a form on a page with a button that once clicked it pops up another sub page:


page2.php has another button, I want to be able to redirect the Main Page to another url using this popup.

Answer Source

If you want to redirect the main page on a button click in the popup, you need to do this with JS, not PHP.

Add this to the button in the popup:


From a popup, you can access the page/window that opened the popup with: window.opener. This means that you also can call functions on the main page: window.opener.someFunctionOnTheMainPage().

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download