Solved

CGi output to a frame

Posted on 1998-10-12
6
243 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
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…

735 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