HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
forcing parent window to open from iframe content.
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Frame
View previous topic :: View next topic  
Author Message
webmaster_rp



Joined: 22 Feb 2005
Posts: 2

PostPosted: Tue Feb 22, 2005 7:16 am     forcing parent window to open from iframe content. Reply with quote

Hello,

i made a website wich haves an IFRAME inside. Its my index.htm. Inside my IFRAME i am going to open other pages like a.htm, b.htm, etc...

What i am trying to do is to open my website correctly, when inputing this address into my Browser "www.mywebsite.com/a.htm".

currently that will only display a.htm

Can anyone help me on this?
chrisxkelley



Joined: 07 Dec 2004
Posts: 246

PostPosted: Wed Feb 23, 2005 12:42 pm     Reply with quote

thats because you are only telling it to display a.htm when you type
www.mywebsite.com/a.htm

for the iframe tag, if you want a.htm to show up you have to set the src as

<iframe src="a.htm">
webmaster_rp



Joined: 22 Feb 2005
Posts: 2

PostPosted: Thu Feb 24, 2005 6:34 am     Reply with quote

Thanks for the help, but maybe my english wasnt good enough.

What i was trying to do was to avoid that, putting an adress like this www.mywebsite.com/a.htm, the browser only displayed only a.htm (instead of a.htm inside the index.htm like i want).

I found this an it solves partially my problem, when inserted in a.htm or other.:
<SCRIPT LANGUAGE="javascript">
if (self==parent){document.write('<META HTTP-EQUIV="refresh" CONTENT="1; URL=index.htm">')}
</SCRIPT>

But what it still no works is, if i put www.mywebsite.com/b.htm this is gonna open the index page with a.htm inside i frame.
I think the problem is the IFRAME SRC="a.htm" in the index page i dont know how to solve it
chrisxkelley



Joined: 07 Dec 2004
Posts: 246

PostPosted: Thu Feb 24, 2005 9:56 pm     Reply with quote

oh i see. you could try using php to solve your problem, if your server supports php. the url would be a bit longer though, if that's okay.

something like:
.http://mysite.com/index.php?page=a.htm

if you are doing it in a hyperlink, not something where your user types the address(basically if length is not a problem), then you should be fine.

the way it works is you use variables in the url to tell the page what to do.
in the url, make your variable. in this case, it's page.

.http://mysite.com/index.php?page=

what comes after the variable is the value it holds(aka the page you want)

.http://mysite.com/index.php?page=a.htm

so then in your index.htm page, for the ifrtame src, just call that variable:

<iframe src="<?PHP echo $page ?>">


what that does is get the variable from the url and "echo" or print out what the variable holds. so if you have .http://....index.php?page=a.htm, it will put a.htm in place of the <?PHP echo $page ?>.


Make sense? i hope so... haha, and hope this works for you.


Cheers,
Chris
Jon



Joined: 26 Aug 2005
Posts: 1

PostPosted: Fri Aug 26, 2005 2:08 pm     Reply with quote

Ok - I'm not sure if I understand the problem description or proposed solution correctly, but I think I have a similar problem:

I am running a vBulletin forum. The main page to our site is not vB - and we don't want to go with a vB like portal (i.e. vBadvanced) - so what we thought we could do is use the news feature of vBadvanced, create a special page where only the news threads are listed and using a php INCLUDE script, simply add this page to the main site.

Well as it turns out. vB doesn't like competition with other header tags, so I get this error that prevents me from including this page like I planned:

"Unable to add cookies, header already sent."

So my next approach would be to try pulling this up in an iframe. Using a conventional iframe link, everything works fine - until I click on a url pertaining to the content of that iframe (such as "reply" to a news article). It then pulls up the entire vB forum inside this iframe which is not what I intended.

Is there a parameter I can add to the iframe code that forces all urls that are within an iframe to open up in the parent page(?) rather than in the iframe itself?

I can't change the vB code from _self to _parent obviously without affecting my entire forums. I thought perhaps there would be another way.

Thanks in advance for any help
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Frame All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial