Three options:
- build your page such that the two frames that you wish to update are contained within another (nested) frameset. Your script writes the containing frameset and causes itself to be called again to write each of the pages within it. 3 cgi calls for each page: very bad. Doesn't require any javascript, though.
- Drop a little javascript in the header of the mainFrame page when you generate that, such that it sends the top frame to a new address that you've built from your cgi parameters. This doesn't necessarily work across domain boundaries, requires javascript, and causes two cgi calls per page. I remember using this approach on oneworld back when netscape 2 first came out (creak. mutter.) and feeling really groovy. ymmv.
- get rid of the frames. If you're regenerating most of the page anyway, what's the point? they just get in your way and annoy your visitors. Put the navigation on the page and send it all out at once. One cgi call, no javascript.
This question comes up a lot on the web authoring lists and nearly always indicates that frames are the wrong approach, imho. If you're going to that much trouble, go the rest of the way and use TT2.