Forum Moderators: coopster

Message Too Old, No Replies

need help with linking to an iFrame

php iFrame linking

         

nekromonik

1:59 am on Oct 29, 2003 (gmt 0)

10+ Year Member



Hi,

Im really new to php, so this one should be pretty easy. My site is split header.php and footer.php, and an index.php that holds these in frames:

<frameset rows="80,*" frameborder="NO" border="0" framespacing="0">
<frame src="header.php" name="topFrame" scrolling="NO" noresize >
<frame src="footer.php" name="mainFrame">
</frameset>

My links are in the header.php file, and are all pointing to the iframe, except for my forums link that I want to load the forums below the header in place of the footer. The problem arises when i try to link back to the home.php, which ideally would load the footer.php again, with the home.php appearing in the iframe. The code lools like this:

<iframe name="center_iframe" src="filez/home.php"></iframe>

links:
<a href="filez/home.php" target="footer.php?center_iframe"><img src="images/nav/home.gif"></a>
<a href="/forum/index.php" target="mainFrame"><img name="msgboard"></a>

Is there a solution to this without diverting too much from this scenario? Thanks in advance.

gethan

9:54 am on Oct 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi nekromonik,

Welcome to WebmasterWorld.

Try using target='_top' for any homepage links.

There are a few other predefined targets...

_self = the current frame or window
_blank = a new window - like a popup
_parent = the parent frame of the current one.

Have fun.

nekromonik

4:23 pm on Oct 29, 2003 (gmt 0)

10+ Year Member



gethan,

thanks for the response. I don't think that will work for me though. The problem is that the home page info is just text that appears in an iframe. Actually, all the links link to the iframe except my message boards link, which will link the the path/to/forums, and will target the mainframe area below. The problem is that when i click on homepage again, it doesnt reload the lower frame again that contains the iframe. How do I target "mainpage.php & iframe"? Take a look at what I have so far, distortions aside. Thanks again.

jatar_k

5:39 pm on Oct 29, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld nekromonik,

can't you just have the home link load mainpage.php into the lower frame?

The framed approach seems to be what is getting you in trouble. Could you not go away from frames and then just include the header on each individual page? That way you could put different links into the header when you are in the message boards section and avoid the problem.

nekromonik

11:13 pm on Oct 29, 2003 (gmt 0)

10+ Year Member



Thanks jakar_t, Im going to try that. It will probably solve the problem. Ill check back. Here's the link though anyways in case anyone wants to look. I thought I posted this before.

[edited by: jatar_k at 12:29 am (utc) on Oct. 30, 2003]
[edit reason] you did, please check your sticky mail [/edit]