Today encountered a problem, behind the framework, when the judge login after the failure to return to the landing page, but the login page is open in the framework, I want it to jump directly out of the frame open (here is not open a new window), finally found a way to share with you:
echo "<script language=\" javascript\ ">alert (' login is invalid or not logged in, please login!") '); location.href= ' login.php ';</script> '; |
The original content is above, to get it out of the frame to open the login page, you need to use the following method:
echo "<script language=\" javascript\ ">alert (' login is invalid or not logged in, please login!") '); window.top.location.href= ' login.php ';</script> '; |
In fact, the jump link before adding a window.top. If you are opening a new window, you can use JS window.open ("url", "open Mode"); To open a new window.