...

View Full Version : Have a problem when screen is refreshed using iframes



cryztal
09-07-2006, 03:15 AM
I have a site I am working on using iframes - the problem I am having is that if you do a refresh it will reset back to the main page - which I could live with if I have to but it does not clear off the htm that is setting in the iframe - I have enclosed hyper link to site -

http://www.factor8movie.com/test2/preload.htm

Site is still wip so none of the links past the news link is active except for the trailer - if you click on say factor 8 movie - synopsis and then do a refresh you will see what I mean - this also happens on the News section also - and feel it will probably happen on all of them if I don't figure out how to deal with this problem -

Thanks for you help - cryztal :rolleyes:

ronaldb66
09-07-2006, 12:46 PM
You could probably throw some JavaScript at the issue, but an easier solution would be to give each page a proper page of its own, which would probably make listing the site in search results a bit easier as well.

There are other issues as well, but we'll leave that to a proper site review.

cryztal
09-08-2006, 09:35 AM
Well I appreciate your response but actually it did not help me at all - I do not wish to have a bunch of pages opening up or I would not have use iframes - I guess I do not understand why you responded at all since you gave me no assistance to my problem other than tell me to have a bunch of pages loading all the time - anyone else have any assistance here - please don't tell me not to use iframes and such - that is no help to me - also telling me to throw java script at it doesn't help me either since i am not an expert at java script - guess your telling me to list it on that forum also - but isnt that against the rules?

Please folks need just a little help here please - :rolleyes:

mlseim
09-08-2006, 03:38 PM
OK,

When you go to your site, you first view:
http://www.factor8movie.com/test2/factor8.htm

Then, when a link is clicked, you load a new page into the <iframe>,
but the "root" page is still: factor8.htm

So, each time you refresh it re-loads that root page.

Somehow, that root page needs to know what page is currently inside
the <iframe>. This can be done using cookies, PHP sessions, or just
PHP scripting.

I think it would be best to use PHP. Every page you have would need the
extension .php instead of .htm

Then, it's a matter of coding...

There are several methods you could use. I particularily like this method,
see: http://www.palosantodesigns.com/

When you navigate around, keep an eye on the URL. It's the same PHP
script (webpage), but a variable keeps track of which page you are on.
In your case, that variable would be keeping track of the URL that's inside
your <iframe>. So, when you refresh the screen, that variable remains
in the URL Address Window of the browser.

It's kind of hard to explain without a real example. The Palsosanto site
does not use <iframes>, but it would sort of be the same thing. That page
variable would be the thing that remembers which URL is in the <iframe>,
so with a page refresh, it would show the correct <iframe> contents each time.

Start out by changing all of your page extensions to .php, and all of your
<a href> links to the new page names (.php instead of .htm).

Once that's done, you can then begin inserting some PHP scripting inside
those pages to control the <iframe> contents .... and most importantly,
to control the URL that displayed in the URL Address box of the browser.

Myself and others can help with some examples. But be patient with us.

EDIT:

I have a better test example here (which uses an actual <iframe> ) :

http://www.catpin.com/test

There are these files:
index.php (which is called for every page that is displayed)
nav.php (which is "included" in the index.php file ... and determines which of the 4 other pages is in iframe)
and 4 other php files that appear within the iframe box.

Display any of the pages and you'll see that the page number is reflected
in the URL address box, so a refresh will always retain the proper page.


.

cryztal
09-09-2006, 04:51 AM
OK,

When you go to your site, you first view:
http://www.factor8movie.com/test2/factor8.htm

Then, when a link is clicked, you load a new page into the <iframe>,
but the "root" page is still: factor8.htm

So, each time you refresh it re-loads that root page.

Somehow, that root page needs to know what page is currently inside
the <iframe>. This can be done using cookies, PHP sessions, or just
PHP scripting.

I think it would be best to use PHP. Every page you have would need the
extension .php instead of .htm

Then, it's a matter of coding...

There are several methods you could use. I particularily like this method,
see: http://www.palosantodesigns.com/

When you navigate around, keep an eye on the URL. It's the same PHP
script (webpage), but a variable keeps track of which page you are on.
In your case, that variable would be keeping track of the URL that's inside
your <iframe>. So, when you refresh the screen, that variable remains
in the URL Address Window of the browser.

It's kind of hard to explain without a real example. The Palsosanto site
does not use <iframes>, but it would sort of be the same thing. That page
variable would be the thing that remembers which URL is in the <iframe>,
so with a page refresh, it would show the correct <iframe> contents each time.

Start out by changing all of your page extensions to .php, and all of your
<a href> links to the new page names (.php instead of .htm).

Once that's done, you can then begin inserting some PHP scripting inside
those pages to control the <iframe> contents .... and most importantly,
to control the URL that displayed in the URL Address box of the browser.

Myself and others can help with some examples. But be patient with us.

EDIT:

I have a better test example here (which uses an actual <iframe> ) :

http://www.catpin.com/test

There are these files:
index.php (which is called for every page that is displayed)
nav.php (which is "included" in the index.php file ... and determines which of the 4 other pages is in iframe)
and 4 other php files that appear within the iframe box.

Display any of the pages and you'll see that the page number is reflected
in the URL address box, so a refresh will always retain the proper page.


.


Thank you so much for your assistance - one thing i would like to make sure I understand is that when I change the extension to php I must also identify the page by using ie(?p=0) also - of course changing the 0 to whatever number is appropriate - when I just change the main page to php the reload will bring it up without the overlay of the orig iframe in it - this in itself is a GREAT improvement - I am going to rework the pages and links as you have indicated and see how it works - I do think you have resolved my problem and will report back once I have made all the adjustments - again - thank you for helping me and for giving me such a great example - :D :D :D :D :D

mlseim
09-10-2006, 01:13 AM
For those following this link ...

Cryztal emailed me privately with some PHP concerns.

Just changing the extensions to PHP is just the first step.
There is some PHP scripting involved that requires some PHP knowledge.

The examples shown are the result (or output) of the PHP script ... thus the
example pages were dynamically generated ... the source shows the HTML
output, not the PHP scripting.

I think she will realize this is going to escalate into a larger project and
hopefully she'll learn a lot about PHP.

We'll keep you posted.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum