Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CGi output to a frame

Posted on 1998-10-12
6
Medium Priority
?
253 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 200 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
New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

 
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 Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

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…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses

963 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