Solved

What is CGI scripting?

Posted on 1997-07-16
3
377 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

867 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

12 Experts available now in Live!

Get 1:1 Help Now