Solved

dynamic content for frames without making files

Posted on 1997-10-30
4
145 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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 …
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

732 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