doumeng4400 2014-01-28 16:17
浏览 47
已采纳

在fra中从框架页面移动到普通页面

hey guys i was working on my college intranet login using php now i created a main page with three frames. this page will come after successful login. the page consists of 2 buttons namely submit and logout. if submit is chosen then based on radio button checked i will be directed to a new page. now my problem is if i click logout button the new page is loaded in the frame rather than full window. i want my new page to open in full window rather than the frame. is it possible??

here is my code:

<frameset rows="20%,80%">
<frame src="stheader.php" name="top" id="top" noresize="noresize">
<frameset cols="15%,85%">
<frame src="stmenu.php" name="bottomleft" id="bottomleft" noresize="noresize">
<frame src="staff2.php" name="bottomright" id="bottomright" noresize="noresize">
</frameset>
</frameset>

the top frame is nothing but an image file in it. the stmenu.php is:

    <h2><u>MENU</u></h2>
<h3><font color="green">Student Database</font></h3>
<ul>
<li><a href="stins.php" target="bottomright">Insert</a></li><br>
<li><a href="stdel.php" target="bottomright">Delete</a></li><br>
<li><a href="stup.php" target="bottomright">Update</a></li><br>
</ul>
    <button type="submit" formaction="staff1.php" target="bottomright" >Logout</button>

now based on this click of the above links, the new page opens in right bottom frame. now if say i click logout button then the page opens in right bottom frame rather than full page. i want it to open full page.

  • 写回答

1条回答 默认 最新

  • dongpo1216 2014-01-28 17:51
    关注

    use javascript for the onclick event :

    window.top.location.href = "http://www.site.com"; 

    or use target attribute as _top

    <a href="logout.php" target="_top">Log out</a>
    

    Refer : Redirect parent window from an iframe action

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog