0

Hi, all

I'm working on a website that is comprised of two iframes within several nested divs ( the frames named "frame-menu" and "frame-main"). Displaying as such:

<div id="wrapper">
    <div id="header">Header text/image goes here</div>
    <div id="menu"><iframe name="frame-menu" id="frame-menu" src="menu.php" frameborder="0" height="30"></iframe></div>
    <div id="main"><iframe name="frame-main" id="frame-main" src="login.php" frameborder="0" width="878" height="700"></iframe></div>
    <div id="footer"><A HREF="about.php" TARGET="frame-main">About Us</A> - Contact</div>
    <div id="bottom">&copy;2015</div>
</div>

When the user logs on via the 'login.php' form, I'd like to reload the 'menu.php' file in the 'frame-menu' frame, to run the PHP conditionals to change the "log in" link to a "log out" link. However, I can't figure out a way to get the menu.php file to reload.

I've tried adding headers to the code of beginning of the page that loads after the user logs in...

header('Window-target: frame-menu');
header('Location: https://www.website.com/menu.php');

and had no luck.

I know this can be accomplished via Javascript, but I'm rather hesitant to use it, as users can turn it off, and, well, completely screw up my login process...

Does anyone have any suggestions for me on this?

Thank you!

4
Contributors
3
Replies
29
Views
2 Years
Discussion Span
Last Post by diafol
0

Have you tried giving your frame a target of the iframe you want to load the response into? Like this:
<form target="frame-menu">

3

Yes users can turn off JS, but the percentage of them is minutely small these days. They could be thought of a "very edge" cases. So not using JS will tie you to alternatives. iframes are a such a mess. They do not respond well to dynamic content. Their heights have to be declared. Urgh. Sounds like a 15-year old workaround. My 2p. I'd certainly rethink this whole approach.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.