Solved

dynamic content for frames without making files

Posted on 1997-10-30
4
146 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

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

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

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…
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

717 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