HTML Frames PHP Displaying Something in a Different Frame

Hello -

I have a three frame window specified as follows:

<FRAMESET cols="10%,90%" framespacing="10">
<FRAME src="maleftp.php" name=maleftp>
<FRAMESET rows="50%,50%" framespacing="10">
<FRAME src="madetl.php" name="madetail">
<FRAME src="malist.php" name="malist">

I would like to simply display a picture (png, etc) in the top frame named madetail from within a php program  that is executing in the bottom frame. The madetl.php is executed initially, but i'd like to display an image in the top frame (madetail) by code executing in the bottom frame (malist.php). How does one interact on elements outside of the frame the code is executing in?
Who is Participating?
jasonsbytesConnect With a Mentor Commented:
ok, yes...

In the <body> tag of the lower frame, we can use javascript to fire a new script with the target set as the top.

Just do something like:
<body onLoad="top.frameName.location.href='somefile.php';">

top.frameName.location.href="fileName.html" targets the frame frameName within the top document.
Each frame is a different script or peice of code.

The script executing in the bottom can post to itself with the top being the target and then display the image that way, but the script running in the bottom can't just display an image in the top one.

dhite99Author Commented:
Ok, if I have a small php program that does nothing but display an image, how do I initiate (execute, run, etc.) that program with the target being the top frame from within a php script running in the bottom frame without user interaction (eg. without having the user click on some link with target=madetail in it).?
You mentioned POST - can the target be specified in post? Example would really help.
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

What event should trigger the image display?

You said it won't be anything from a user...  What will it be?
dhite99Author Commented:
When a user clicks a navigation button in a left frame, it specifies that a program should start in the lower frame via a link specification:

a target=malist href="mklist.php">

The "target=malist is the lower frame. When that program is started, I need to start another program with the target being the upper frame, labeled madetail. This small program will simply display an image.

I feel like this has to be a simple thing to do, but the answer really eludes me. Any help is most appreciated!
dhite99Author Commented:
I apologize for my being dense, but should I specify (literally, assuming the top frame is named madetail) <body onLoad="top.madetail.location.href='somefile.php';"></body>  to get this to work?
dhite99Author Commented:
Here is what finally did the trick - using onClick on the navigation button to reference the top frame as follows:

<a target=malist onClick="top.madetail.location=\'madetl.php\';" href="malist.php"

This link really helped out :

Thanks for your input, jasonsbytes.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.