Home > Archive > PHP Language > May 2004 > variables between frames
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
variables between frames
|
|
|
| I am wondering if anyone here can help me with this problem I have:
I am doing a page for my fathers company and I have this nice
javascript-php menu that I use to navigate through the pages...I have
a page called index2.php that takes in different arguments like
.php?page=oil&info=fuchs...
My problem is that I have frames (I have this because I want to have
different logos under the menu depending on the page you are
currently at, and I also want the menu visible when you scroll down
the product list. So, the menu and these different logos (who depend
on my switch-case) are both in the top frame, while the result from
the menu selection goes to the bottom frame (I just set the target of
the top frame to my frame named "main")
Now to the problem:
The mainpage displays the information correctly, but the logos
doesn't show in the top frame. I suspect this has to do with me
sending the link to the main frame, so my switch-case( page =
_GET['page'] ) in the top frame doesn't work.
Can anyone help me with some code or something that shows me how to
send php variables between frames in a frameset?
And I know many of you don't like frames, so you don't have to
tell me not to use them ;)
----------------------------------------
The post originated from PHP Freaks:
----------------------------------------
http://www.phpfreaks.com
http://www.phpfreaks.com/forums
| |
| Janwillem Borleffs 2004-05-23, 8:32 am |
| hube wrote:
> Now to the problem:
> The mainpage displays the information correctly, but the logos
> doesn't show in the top frame. I suspect this has to do with me
> sending the link to the main frame, so my switch-case( page =
> _GET['page'] ) in the top frame doesn't work.
>
You can only do this with JavaScript by changing both frames with a single
click, e.g.:
<a href="page.php" onclick="navigate('page'); return false">Go to page</a>
....
<script type="text/javascript">
function navigate(page) {
parent.frames['frame1'].location = page + '_sub.php';
parent.frames['frame2'].location = page + '_main.php';
}
</script>
Another good reason to move away from frames as far as possible ;-)
JW
|
|
|
|
|