?
Solved

"CREATING" HTML using CGI

Posted on 1998-08-03
7
Medium Priority
?
294 Views
Last Modified: 2013-12-25
I have created a form and am trying to PERMANENTLY save the data as a NEW HTML document.  Example -  14 people fill in information into a form ( i.e. Name, Question Responses, etc...) and I am trying to PERMANTENTLY save their answers in HTML format so the other 13 people can view the responses in a readable format.  The names of the saved file may be answer01.html, answer02.html,....  I know the 14 people and can use a pick list referencing an array to predetermine the saved file name.  

Is this possible using JavaScript or CGI!!!
Can a person RE-SUBMIT their answers and successfully override the current file of the same name that aready exists?
Can I control the format of the saved file?
0
Comment
Question by:youngman072798
[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
7 Comments
 

Expert Comment

by:samasan
ID: 1831326
Can you be more specific?  Will the CGI implementation be in Perl, C, sh?  You can do it and it is relatively straight forward, but I need to know which language or which OS this will be on.
0
 
LVL 28

Expert Comment

by:sybe
ID: 1831327
Not with Javascript.

I would do what you want by saving the information in a database and use a cgi to get it out.
0
 
LVL 6

Expert Comment

by:alamo
ID: 1831328
You can use CGI to do what you want, not javascript. Since CGI is just a program that runs in response to a request from the web, then as long as you can write a program to write the files and read them back it can be done with CGI.

Personally, I'd save it the results to files as you suggest, rather than a database, because it's a little easier and it sounds like it fits your needs.

Actually, I'd probably save all responses to a single HTML file that your users can view them at once, and each new update would overwrite only the relevant section of the HTML file. But I'd do it in perl, which is really good at this sort of text manipulation. If you don't know perl, separate files is probably easier.
0
AWS Certified Solutions Architect - Associate

This course has been developed to provide you with the requisite knowledge to not only pass the AWS CSA certification exam but also gain the hands-on experience required to become a qualified AWS Solutions architect working in a real-world environment.

 
LVL 1

Expert Comment

by:slinky
ID: 1831329
There are a number of bulletin board type Perl apps available on the Web would might suit your purpose. It would mean you'd only have to get Perl and not have to learn it
0
 
LVL 1

Expert Comment

by:KEWL
ID: 1831330
With Standard HTML you could use a form with the POST methods to write to a file
0
 
LVL 1

Expert Comment

by:evilgreg
ID: 1831331
As far as "resubmitting" and overwritting files, that will require some sort of username/password scheme. "Controlling the format of the file" will require some extensive parsing, if you are hoping to filter out selective HTML, for example. Both of these add a lot of complexity to your original request, which is fairly simple, but will also be fairly open to abuse.

A simple perl cgi script is enough for the first part. Perl could also handle the authentication and parsing, but, it wouldn't be so simple anymore. I personally think a small database (i.e. one file on ethe server) would be easier than using 14 html pages.





0
 
LVL 8

Accepted Solution

by:
Answers2000 earned 20 total points
ID: 1831332
You can't do it with JavaScript.  You can do it with CGI.

Write a perl or C program to (1) write out the file(s), or (2) insert the information into a database (or a file format you can invent).  If you follow solution (2) you will also have to write CGI programs to query the information and generate new pages on the fly.

Be aware of security holes, especially if the system is open to the Internet (as opposed to on an Intranet).  You didn't want anybody writing rubbish to your server.  Definitely make sure that none of the files can be executed!
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
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…
Suggested Courses

770 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