Solved

CGi output to a frame

Posted on 1998-10-12
6
240 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
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 
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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

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…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 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