0

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.

2
  • 1
    For that you would need to execute a javascript from OUTSIDE the frames (AFAIK). But frames are pretty deprecated these days. They don't look very good and problems like this tend to happen... Maybe try using php includes instead of frames (if possible)
    – theCNG27
    Jan 28, 2014 at 16:20
  • Nobody should be creating pages using framesets in 2014. Framesets are obsolete, and have been so for a very long time.
    – Spudley
    Jan 28, 2014 at 17:29

1 Answer 1

1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy