Solved

What is CGI scripting?

Posted on 1997-07-16
3
373 Views
Last Modified: 2013-12-25
I have no idea what cgi scripting is and I want to learn.  I have no experience in programming except a little basic.  Can someone help me out?  I want to write a guestbook that askes for name, url, e-mail address, and a comment and then re-writes the pages html to post the message at the bottm of the page.  I have one that works like this at http://members.tripod.com/~Hypes_World/ryan.html   someone else set it up for me though and I don't know who his is so I want it to work like that one.  I tried to copy it out of that page, but it doesn't work.  I am writing a new page at my college.  Thanks for any help
0
Comment
Question by:rbirk
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
icd earned 100 total points
ID: 1829108
Since you already have a script on your page then it would seem there is no problem with your service provider allowing you to run your own scripts. (Or did the service provider set it up for you?). However since it is in the /bin/ directory and your directory seems to be a members directory then it is possible that you don't have access to it. You must check with your service provider if you are not sure. The main check is, are you able to ftp files into the bin directory in the same way as you can ftp to your ~Hypes_World directory?

CGI scripts are usually (but not exclusively) written in perl. This is an interpreted language and is a little like C. There are many, many scripts available on the Web to download including ones to write guestbooks. It would be worth your while at least looking at them to find out how they work before re-inventing the wheel.

You will not be able to copy scripts off the internet directly. They are usually in directories that allow the file to be executed but not read. In your case it is in the bin directory, usually they are in a directory called cgi-bin. Sometimes they can be put in the same directory as html files by being given the extension .cgi but this is a security problem and is not often done.

The best way to learn about cgi programming is to obtain the 'Llama' book which teaches you perl and cgi programming.

'Learning Perl by Randal L. Schwartz ISBN 1-56592-042-2'

0
 

Author Comment

by:rbirk
ID: 1829109
I am switching service providers from tripod to iowa state university and I asked them about guestbooks and they said they don't have one available for me.  So what do I need to do?  Download a script and put it in iowa states cgi-bin dir and add some stuff to my html page?  Why isn't it possible to just use Java or Html to write a page to accomplish this task?  This cgi crap is too damn commplicated and is far beyond my reach.  I have never programmed in C and think it is such an archaic language that it shouldn't even be on the market, even though I realize it is one of the most powerful languages available.  Why can't we have languages as simple a basic yet as powerful as C?  I wish I knew how to do this CGI stuff, but I don't understand why it is all nececary.  LAter all.
0
 
LVL 5

Expert Comment

by:icd
ID: 1829110
As I said above. If iowa state university allow you to run your own scripts then you would indeed need to download it.

There are many scripts available to do guestbooks etc. There are a few (good quality) scripts at the following:-

http://www.technotrade.com/cgi/index.html

Mostly scripts are written in Perl and in my opinion it is a simple yet powerful language, in the area of text manipulation it is even more powerful than C. I would however dispute your opinion that is is 'archaic' especially when you refer to the language 'basic' in the same sentence! :-)

You cannot use HTML since it has no means of writing to either the server or the client computers. Java is indeed an option but since it is effectively a 'trimmed down C++' then I expect you would not think very highly of it. :-)

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
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)

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now