Jump to content

Recommended Posts

My problem is that i have a menu and a content iframe (created in index.html) on my page and after the user is logged in, the menu.php in iframe:menu should reload, so the user gets the menu which should appear in logged in state.
The problem is the login.php is loaded in the content iframe, and the menu should be reloaded from that one (login.php). I tryed several way to refer to the menu.php, in the menu frame, but without success.

The whole thing i wanna do to execute  <a href="menu.php" target="menu">reload the menu</a> without clicking on it, so when the login process suceeded, the menu change to the logged in version immediately. And after logging out, it would change back. If i put this link in it and click on it, it works perfect.

<script type="text/javascript">
document.getElementById("menu").src="menu.php"
</script>  don't work



Link to comment
https://forums.phpfreaks.com/topic/34938-some-problem-with-iframes/
Share on other sites

In the file, what creates the frames (index.html), there are only the frame creations, which loads the menu in, and leave the content page empty. and when u click on -> Log in in the menu, u can log in on the content page. is it successful, the menu.php should reload in the menu frame. (it checks from the session, that user is logged in or not, and display the menu needed). And ofc it should reload after logout too.

index.html:
<iframe name="menu" id="menu" src="menu.php" target="main" width="15%" height="100%" align="left" border="0">
</iframe>
<iframe name="tartalom" id="tartalom" src="empty.html" target="main" width="85%" height="100%" align="right" border="0">
</iframe>

menu.php:
...
<?php
if (user logged in...)
{
?>
<a href="logout.php" target="tartalom">Kijelentkezés</a><br><br>
<?php
} else {
?>
<a href="login.php" target="tartalom">Belépés</a><br><br>
<?php
  }
?>
...

So my question is, that at the end of the login.php and logout.php how can i reload the menu.php without using
<a href="menu.php" target="menu">reload the menu</a> in them.
Or if u can suggest me any better idea how to do this, i would be happy for that too. Thx

http://villornet.freeweb.hu/ u can check it here

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.