I really hated that javascript answer above (bs answer imho).
This is more of an html question than a CGI one
While I have no clue what your frame structure looks like, here's some advice:
//index.pl
frame1 = foo1.pl
frame2 = foo2.pl
frame3 = foo3.pl
there's a form on frame1, and you want it to update frame1 frame2 and frame3 when it's submitted
the solution, specify target=_top
If you wish to update only 2 of the 3 available frames, the answer is the same, specify target=_top and update the entire frameset (if it's all in one frameset).
If you have 2 framesets, frameset1 which has frame1, and frameset2, which has frame2 and frame3, and you wish to update only frames 2 and 3, then just update frameset2, and frame1 can remain without changing.
I also sugguest you specify an expiration date for each of the pages, so people can take advantage of
caching (this prolly means a the same get string)
If you have no idea what i'm talking about, form target
Now for the perl part
#!/usr/bin/perl -wT
#index.pl
use CGI qw/ :all /;
my $fs = param("fs") || 0; # frameset
my $fr = param("fr") || 0; # frame
## only numbers are acceptable
$fs =~ s/\D//g;
$fr =~ s/\D//g;
$fs ||= 0; # if they weren't defined, or were gibberish
$fr ||= 0; # they best be 0
$|=1; # unbuffer
print header(-type => 'text/html', # cache only for five minutes
-expires => '+5m' ), # you clients that cache
if($fs == 1)
{
&generate_frameset1();
}
elsif($fs ==2)
{
if($fr == 2)
{
&generate_frame2();
}
elsif($fr == 3)
{
&generate_frame3()
}
else
{
&generate_frameset1();
}
}
else
{
&generate_frameset_all();
}
### ... the actual subroutines below
### index.pl writes something like
<frameset 1>
<frame src ="index.pl?fs=1;fr=1;">
<frameset 2>
<frame src ="index.pl?fs=2;fr=3;">
<frame src ="index.pl?fs=2;fr=3;">
</frameset>
</frameset>
I think this is plenty to get you started, lemme if it helps out (and what you settle on).
Do remember, javascript is a client-side. paranoia, paranoia, paranoia...
___crazyinsomniac_______________________________________
Disclaimer: Don't blame. It came from inside the void
perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.