?
Solved

Beginner: Simple CGI (and related questions)

Posted on 1998-11-19
10
Medium Priority
?
227 Views
Last Modified: 2013-12-25
Hi,

 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,

Zif.
0
Comment
Question by:ZifNab
  • 5
  • 5
10 Comments
 
LVL 8

Accepted Solution

by:
MaDdUCK earned 400 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?

yes.

>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?

MaDdUCK
0
 
LVL 8

Author Comment

by:ZifNab
ID: 1829668
Hi,

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.
0
 
LVL 8

Expert Comment

by:MaDdUCK
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,
later
MaDdUCK
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 8

Author Comment

by:ZifNab
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).

0
 
LVL 8

Expert Comment

by:MaDdUCK
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...)
0
 
LVL 8

Author Comment

by:ZifNab
ID: 1829672
Last question :

What is better :

JavaScript or CGI-script for accessing database?

Pro & Cons?

Regards, Zif.
0
 
LVL 8

Expert Comment

by:MaDdUCK
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.
0
 
LVL 8

Author Comment

by:ZifNab
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.
0
 
LVL 8

Expert Comment

by:MaDdUCK
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.
0
 
LVL 8

Author Comment

by:ZifNab
ID: 1829676
Thanks MaDduck!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Question has a verified solution.

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

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses
Course of the Month13 days, 12 hours left to enroll

755 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