• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • Last Modified:

Beginner: Simple CGI (and related questions)


 I've some q'ns in my mind, hope you can answer them.

1. What is the difference: CGI, ISAPI, ...
2. CGI has to be placed on an Webserver?
3. Can CGI work on a normal PC? How?
3b. Can CGI work on a standalone PC?
3c. Can CGI work on a plain PC connected to internet (by phone)/intranet?
4. When connecting CGI with database, has database to be on server? Or can database be stored anyware on a normal PC (somewhere on the intranet, or connected to the web by phone).
5. Can a PC on an intranet have the database?
6. Which databases can be used? Easy Paradox, Access or does it have to be Oracle ...

Thanks in advance,

  • 5
  • 5
1 Solution
>1. What is the difference: CGI, ISAPI, ...

CGI is more common and flexible wherease ISAPI (internet service application programming interface) or nsapi (netscape ...) are server specific. the last two provide more functions specific to the server but cannot be used anywhere else but with those servers. CGI can be used with just about any webserver and is platform independent.

>2. CGI has to be placed on an Webserver?

yes, the deal is that it is executed by the server and controlled via user input in the browser.

>3. Can CGI work on a normal PC? How?

an easy way to ge this done is to install a small webserver on the computer and to access it using the 'localhost' name.

>3b. Can CGI work on a standalone PC?

yes it can, but what is the use? you want CGI in an internet or intranet so that people can use its dynamic features.

>3c. Can CGI work on a plain PC connected to internet (by phone)/intranet?

yes, but it will only be available while you are connected

>4. When connecting CGI with database, has database to be on server? Or can database be stored anyware on a normal PC (somewhere on the intranet, or connected to the web by phone).

it can be somewhere on a network but it has to be accessible at reasonable speed from the webserver

>5. Can a PC on an intranet have the database?


>6. Which databases can be used? Easy Paradox, Access or does it have to be Oracle

anything can be used as long as you have a nice programming interface for it. Perl usually goes well with Oracle (check www.perl.com/CPAN/ for modules) whereas Win32 programs will easily work with Access. If you have an interface, you can use any database.

anything else? or am i not clear anywhere?

ZifNabAuthor Commented:

Thanks already for the quick response, but now I've got other q'ns:

CGI-script : different per database? Can an Access CGI-script also work for an Oracle CGI-script?

Assume that I've a PC on a network. This PC will have the database, it is also connected to intranet. Somebody of the internet wants to get information from it. How does it work then? Do I write a html page, refering to the CGI-script on that on PC with database?

Assume this database and html pages have to be transferable to another PC, but without network. A standalone one. How can I let the CGI-script work? Can you be more specific? Thanks.

Why I'm asking this? I've to write a sort of book, with several (tons) of information. This information will be categoried. And per category same types of information has to be inserted.

This has to run on a plain computer (standalone PC). And on a network (multiple computers will contact this book.

We want to write this book in html.

The book has to be changeble for other users. i.e. some type of information can be changed. BUT, people who have to do this, don't know anything of html! So the html should be very limited.

book has to viewed with minimal cost. i.e. using a simple browser which are nowadays free! = no cost.

What we can do (in my opinion) :

1. Write a program which reads customised html-pages and let the user visually change the context of it (drag&drop) some sort of VERY simple wysiwyg html-editor. The changed page can be written to disk and links will be automatically created.

-> easy on standalone pc
-> writing small wysiwyg html-editor (and all other stuff) is not so easy
-> what if has to be put on network? Not so difficult, because everything are just plain html-pages. Lot's of diskspace dough.
-> maintenance will not be that easy!

2. Make a database (but lot's of information has to be stored!!!) and make a CGI-script to do it.
-> difficult, making database!
-> easy maintanance, change database values
-> easy? for network, less disk-space?
-> difficult for standalone pc?

3. Other ideas? you seem to know a lot of this.

Thanks, Zif.
>CGI-script : different per database? Can an Access CGI-script also work for an Oracle CGI-script?

no, unless you have a really good interface which is database format independent and can take care of this. I have not yet seen one of thos. What purpose is your CGI script? Based on the application, I can probably tell you the best database to use. In general, try to go with Oracle though!

>3. Other ideas? you seem to know a lot of this.

here is what I would do (I did something similar):
A CGI script basically dynamically creates HTMl pages and displays them. I would take the CGI out of the CGI and make a simple programn which creates HTML pages based upon the database. You would have one central database which will contain all the info in nicely categorized ways and which is updated. You will also have some sort of application (like a simple console application) that, upon run will do the following:

create all HTML pages of the project (book) and name them according to some naming scheme (00000001.html 00000002.html etc.) The database can keep a temporary record of these filenames so that cross linking is possible. Once all these files are created you can put them up on the intranet as regular website and distribute the files to your liking. Once an update is made, the script is run again to update all HTML pages.

I am sure there is programs out there which will do exactly this but I have not come across one. I wrote my own version of it and I would give it to you except that it is covered by a copyright license of my company which would make it illegal for me to give it to you for free. Besides this, it is still in beta and used for a slightly different purpose.

I will keep looking for such a programm and when I have one, I shall tell you! What also comes to my mind is that Microsoft Access can convert forms to HTML pages. If you would create a form with the information equivalent to a page, run a query on it and save the info as HTML, this may do the trick. I have not played with Access that much yet because I do not like it and Microsoft that much, but have a look into it...

gotta go,
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

ZifNabAuthor Commented:
Thanks for the info. I thought I had to go trough this way. But, it is so hard to do... and the database itself also has to be transported to other users, because they've to make their changes in it too. That's why I thought of making a program which enables the user to easely change a html-page, without changing the lay-out. This way no database is needed either.


But you say CGI is for dynamically making html. Isn't this what we want? Just give user database and some htmlpages with cgi-script. Using these, he'll also see the pages, but you didn't have to copy the html pages to him (only database).

yesm but a CGI requires a web server and thus in order for a stand-alone computer to view the pages, a web server is needed on this computer. I still believe the best solution to be a webserver on the intranet which then has to be accessed through the intranet...and no local copies (these,however, can still be made by saving all files of the CGI output to disk-can be done automatically...)
ZifNabAuthor Commented:
Last question :

What is better :

JavaScript or CGI-script for accessing database?

Pro & Cons?

Regards, Zif.
CGI is definitely better because it is Server Side unlike Java which is Client Side. Your database probably lies on the server. Furthermore, some clients do not support Java (Lynx) and others have turned it of (me), but noone can disable a CGI but you. You have more control over what's going on with a CGI, including more control over the data. If you were to let Clients change data, you would have no control over how hackers could access the database.
ZifNabAuthor Commented:
Euhm, then I've another question :

1.If I need to make a database that can be placed on a server. So that other PC can reach it through HTML.

2.If I need to make it possible that this database can be placed on a plain PC too, and that the user of this pc, can reach this database also by html

Is it then possible to use CGI-scripts? I mean, let say, option 2 will be placed on a Win95/Win98/WinNT (not workstation NT) PC, is CGI then possible? And, if so, how?

Is JavaScript the only way?

Just to make it possible not to make two different programs. Or are there tools that can convert CGI-scripts to JavaScripts or other scripts that can run on a non-server PC so that a database can be reached by html.

Regard, Zif.

And thanks again.
no such tools that I know of.

To run CGI you need a webserver. Basically my comment from
Thursday, November 19 1998 - 03:40PM PST
is your best choice unless you want to set up a webserver on every PC that needs to read the database.
In the case of using the database without a webserver, JavaScript may work, but I would not know how or how well. For the server, I suggest CGI though. There is not one method which you can use for both.
ZifNabAuthor Commented:
Thanks MaDduck!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now