Solved

dynamic content for frames without making files

Posted on 1997-10-30
4
141 Views
Last Modified: 2013-12-25
I intend to implement a CGI program that generates a web page with two frames, each frame containing one field that is slightly customized.   As I understand it, the frames always have to point to other documents.  Is that
correct?  I don't want to have to create two new documents that live on my server, every time some one calls my CGI program.  The server really has no use for the documents once they go to the browser.  Is there a way to do
"inline" frames?  

(Details: I only need to support Netscape; this is an intranet application with fairly sophisticated users.  I am embedding hidden fields, because one frame has buttons that cause changes to happen with a CGI program running in another frame, and the instances of these two CGI programs need to know who they're talking to. The CGI programs are written in C on Solaris for Apache.  I can generate new "temporary" documents if need be, but then I'll
need some sort of cleanup process to remove them, and I'm not sure when it's really safe to remove them, in case they reload the pages, etc.)

Thanks for helping.
0
Comment
Question by:steve_howell
  • 2
4 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 1831019
The frame documents can be CGI programs too
0
 
LVL 6

Accepted Solution

by:
alamo earned 100 total points
ID: 1831020
There's no need to generate 2 static documents - it's much easier to simply call yourself in those two frames, passing the needed arguments. For example, if the main page is loaded by

mycgi.exe?arg1=x&arg2=y

then have mycgi.exe check for a frame argument and if it's not found it writes the frameset with frames as:

<FRAME SRC="mycgi.exe?arg1=x&arg2=y&frame=1">
<FRAME SRC="mycgi.exe?arg1=x&arg2=y&frame=2">

If the frame argument is "1" you write frame 2's page, etc.

Since the primary invocation (the one which writes the frameset) makes all the decisions, you might need to add arguments to the secondary invocations that reflect that.  If it's easier for you to build separate CGIs rather than look for frame=x then instead frame1 could call mycgi1.exe and frame2 could call mycgi2.exe.

If for whatever reason the above isn't practical, you could also write the frame documents dynamically using Javascript in the main document. But in many ways that is more complicated, and is completely dependent on javascript being enabled.
0
 
LVL 6

Expert Comment

by:alamo
ID: 1831021
I posted my answer before I saw you comment, ozo, I wasn't tring to jump in.

Er, 'if the frame argument is "1" you write frame 2's page, etc' is a typo obviously. Or... let's see... I was using 0-based indexing. Yeah, that's it. That's the ticket.
0
 

Author Comment

by:steve_howell
ID: 1831022
Both ozo and alamo answered my question perfectly.  For some reason it was in my head that you couldn't do CGI from a frame src.  Glad to have it cleared up.  
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now