• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 219
  • Last Modified:

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>
<FRAMESET rows="50%,50%" framespacing="10">
<FRAME src="madetl.php" name="madetail">
<FRAME src="malist.php" name="malist">
</FRAMESET>
</FRAMESET>

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?
0
dhite99
Asked:
dhite99
  • 4
  • 3
1 Solution
 
jasonsbytesCommented:
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.

0
 
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.
0
 
jasonsbytesCommented:
What event should trigger the image display?

You said it won't be anything from a user...  What will it be?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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!
0
 
jasonsbytesCommented:
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.
0
 
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?
0
 
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 :  http://htmlhelp.com/design/frames/usage/targeting.html

Thanks for your input, jasonsbytes.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now