Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

(crazyinsomniac) Re: Hierarchical HTML frame processing (somewhat OT)

by crazyinsomniac (Prior)
on Nov 08, 2001 at 13:32 UTC ( [id://124024]=note: print w/replies, xml ) Need Help??


in reply to Hierarchical HTML frame processing (somewhat OT)

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;"

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://124024]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-26 04:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found