Solved

CGi output to a frame

Posted on 1998-10-12
6
251 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
[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
  • 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
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.

 
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

Setting up LaraDock for Laravel

Learn how to set up LaraDock in a Laravel project - LaraDock gives us an easy way to run a Laravel application using Docker in a single command.

Question has a verified solution.

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

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
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…
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…

624 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