問題描述
我在 IFRAME 中有一個簡單的表單.當用戶單擊提交時,它會重定向到我服務器上的特定頁面.我用于重定向的函數是
I have a simple form which is inside IFRAME. When user click on SUBMIT, it redirects to a specific page on my server. The function I use for the redirect is
header ('Location: mypage2.html');
exit ();
但我希望新頁面在 _top 位置打開,而不是在我使用的同一個 IFRAME 中.如何告訴瀏覽器在 _top 中而不是在 IFRAME 中打開新頁面?提前致謝.
But I want the new page to open in _top location, not inside the same IFRAME that I use. How can I tell the browser to open the new page in _top not inside the IFRAME? Thanks in advance.
推薦答案
您在 PHP 中無法達到預期效果.這是您必須從 JavaScript 執行的操作或將 target
屬性添加到 :
You are not able to achieve the desired effect in PHP. This is something you'd have to do from JavaScript or add target
attribute to <form>
:
<form ... target="_top">
這篇關于PHP“標題(位置)"在 IFRAME 內,加載到 _top 位置?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!