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 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)
  • ¥20 matlab yalmip kkt 双层优化问题
  • ¥15 如何在3D高斯飞溅的渲染的场景中获得一个可控的旋转物体
  • ¥88 实在没有想法,需要个思路
  • ¥15 MATLAB报错输入参数太多