Beginner: Simple CGI (and related questions)

Posted on 1998-11-19
Last Modified: 2013-12-25

 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,

Question by:ZifNab
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
  • 5
  • 5

Accepted Solution

MaDdUCK earned 100 total points
ID: 1829667
>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 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?


Author Comment

ID: 1829668

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.

Expert Comment

ID: 1829669
>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,
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 1829670
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).


Expert Comment

ID: 1829671
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...)

Author Comment

ID: 1829672
Last question :

What is better :

JavaScript or CGI-script for accessing database?

Pro & Cons?

Regards, Zif.

Expert Comment

ID: 1829673
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.

Author Comment

ID: 1829674
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.

Expert Comment

ID: 1829675
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.

Author Comment

ID: 1829676
Thanks MaDduck!

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Logon script fails 23 61
Advice on a batch file that copies, moves, sftp's & deletes files 6 36
size of file 1 24
Error when Running powershell script 6 31
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

733 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