on iFrame_1 link click change iFrame_2

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jr
Forum Commoner
Posts: 99
Joined: Mon Mar 07, 2005 3:25 pm

on iFrame_1 link click change iFrame_2

Post by Jr »

Basically I just dont know how to update one I frame onClick of a link from another.

This is the situation:
I have a page that has 2 iFrames and I wanted to make it so one pulls data from a table and makes a list of links. Then onClick of one of the links the second iFrame queries data corrisponding to the ID (or whatever) and pulls from a different table and shows the corrisponding information.
Jr
Forum Commoner
Posts: 99
Joined: Mon Mar 07, 2005 3:25 pm

Post by Jr »

I found this but it updates the first iFrame on the test_2.php page for some reason when the link on test_3.php is clicked. I don't know any JavaScript so I really dont know what to look for here can someone help?


test_2.php:

Code: Select all

print &quote;<iframe src='test_3.php' name='base_iframe'></iframe>&quote;;
print &quote;<br><iframe src='about:blank' name='content_iframe'></iframe>&quote;;
test_3.php:

Code: Select all

print &quote;<a href='#' onclick=\&quote;parent.frames&#1111;0].location ='home.php';return false\&quote;><img src='image/edit.gif' width='50' height='50' border='0' /></a>&quote;;
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

not to sure what your asking but you want to be able to click on a link in 1 iframe and have it open in the other iframe rite? well then just name your iframes
<iframe name=frameA> and <iframe name=frameB> then on the links in frameA do target='frameB'> and the links in frameB do target='frameA'>

hope that helps
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

I believe he means passing on variables from one frame to another frame.

If that is true:

In that case. the most easy way to accomplish that is to pass vars trough the url either encoded or whatever using $_GET / $_REQUEST to retrieve them. SESSIONS dont really work i believe.. since using SESSIONS to jump screens isnt such a good idea.
Jr
Forum Commoner
Posts: 99
Joined: Mon Mar 07, 2005 3:25 pm

Post by Jr »

just named them.

Thanks...
Post Reply