Solved

CGi output to a frame

Posted on 1998-10-12
6
235 Views
Last Modified: 2013-12-25
I'm in the process of updating the cgi web interface for my company's web page. Currently, the cgi's response to a form submittal is written to stdout and immediately updated in the browser. What we'd like to do now is change the response page to a frame. I'm confused as to how to update the page from the cgi.

So far what I've designed are two .htm files. One contains the frameset definitions (of four frames) with the src definitions which all refer to sections of one file. That one files has <a name=X> tags to indicate the data for each frame. Do the src tags in the frameset definition HAVE to refer to a file? Can I write the frame def file to disk and write out the new data to stdout? How does it know to refresh the framse def file?

I'm doing this on Windows NT 4.0 (srvc Pack 3) and in C++.

Thanks
0
Comment
Question by:winkle
  • 3
  • 2
6 Comments
 

Expert Comment

by:krassiB
ID: 1829038
Hi! As I understand you need to change dynamic the content of four different frames of your main page refers to different places in only one file? If it os so, you can do this without problems:
If the second file contains many different <a name=sectionX>
You can simply send to stdout your main html file with frames defs from C++ code. For instance:

.
cout
<< "<FRAMESET>"
<< "<FRAME SRC=\"X.html#section1\">"
<< "<FRAME SRC=\"X.html#section2\">"
<< "<FRAME SRC=\"X.html#section3\">"
<< "<FRAME SRC="X.html#section4">"
<< "</FRAMESET>";
.

You can change when you need sections names you refers from code!

Regards!
0
 

Author Comment

by:winkle
ID: 1829039
Thanks krassiB,

Just to clarify though, as per your suggestion I'd have to have the cgi write any changes to X.html on disk?
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 100 total points
ID: 1829040
In the page (not the framename is case sensitive)
1. <FORM ACTION="cgi-bin/mycgi.pl" TARGET="X">

OR in the cgi
2.
print("Content-type: text/html\n")
print("Window-location: X\n\n")

If you want to have one cgi write the frame definition AND the data that goes in them, you will have to write the data in a javascript in the head of the frameset and have the javascript update the frames.

A frame src may be a cgi too
<FRAME SRC="cgi-bin/myframecontent.pl">

Enjoy,

Michel
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1829041
Oops, a typo:
In the page (not the framename is case sensitive)
should be
In the page (note that the framename is case sensitive)

Michel
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1829042
PS: you can also create a url from your form and target it to another frame with JavaScript (top.X is the target frame):
<FORM NAME="myForm">
<INPUT NAME= "myField" TYPE="TEXT">
<INPUT TYPE="BUTTON" onClick="top.X.location='cgi-bin/mycgi.pl?myField='+ this.form.myField.value;">
</FORM>
Michel
0
 

Expert Comment

by:krassiB
ID: 1829043
Yes if you want to change content of sections.
May be it is better to send me your html files...
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
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 how to count occurrences of each item in an array.

705 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