Re: Which script runs first?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rory Browne wrote:
> I don't know much about frames(I hate the things), but the only thing
> I'd count on would be that the main frame will be loaded first. would
> it be possible to load your session variables in this?

I wouldn't even count on the WHOLE file being loaded either...

EG:
<FRAMESET ...>
  <FRAME ...>
  <FRAME ...>
  <NOFRAMES>
    Tons of stuff here -- the browser *could* be smart enough to start
loading them things up there before it processes all this...
  </NOFRAME>
</FRAMESET>
Much less a bunch of JavaScript garbage here.

> Another possibility would be to have the left frame do the loading of
> variables, and have the frame on the right as "loading". Then when the
> left frame has loaded the variables, you can use javascript( using
> document.frames IIRC) to load the right page. This way you can be sure
> that the left page is loaded before the right page, since it is the
> left page that actually does do the loading of the right page. Your
> page is kinda screwed though if a visitor turns off javascript, like I
> do when I have the displeasure of having to use IE on Windows.
>
> Apologies Rens if you recieved this twice. I forgot to CC it the first
> time.
>
> On Sat, 08 Jan 2005 13:17:54 +0100, Rens Admiraal
> <mailinglists@xxxxxxxxxx> wrote:
>> The way frames are loaded is actually dependent of many things I think
>> (size and browser e.g.), so, most secure is to use javascript, or, let
>> PHP check if the var is set, and if not, reload...
>>
>> you can do this like this:
>>
>> javascript:
>> left.php:
>> <body onload="parent.frames['targetframename'].location='page'"> // can
>> be a little different, but I think it is correct...
>>
>> PHP method:
>> in main.php:
>> if (!isset ($_SESSION["var"])) header ("location:
>> {$_SERVER["PHP_SELF"]}"); // or something like this what will do the
>> same...
>>
>> gustav@xxxxxxxxxxxxxx wrote:
>>
>> >Hi there!
>> >
>> >I have two frames, one with left.php in the left frame and one with
>> >main.php in the right frame.
>> >
>> >I refresh the contents of main.hp at the end of left.php.  (With help
>> of
>> >Javascript actually, maybe could be done with HEADER(...))
>> >
>> >My Question:
>> >Is it ALWAYS so that left.php must be executed before the right frame
>> is
>> >loaded? I wonder this because a session-variable are set in left.php
>> that
>> >main.php is dependent of. So this session-variable must be set before
>> >main.php is loaded.
>> >
>> >
>> >/G
>> >@varupiraten.se
>> >
>> >
>> >
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux