For the purposes of this discussion, the server will be a UNIX server. Of course you can use other operating systems, but this is the most common one, and most likely, this will be the one you find if you use a high powered server rather than your own personal computer.
We further assume that on your desktop PC or Mac, or whatever, you can run
a multi-windowed set of programs, one of which should be a net browser such
as Mosaic or Netscape, and another of which should be telnet (to communicate directly
with the server).
We assume that you are directly connected to the internet, so that each
of these can be active.
You might want a calculator window open also, but this is clearly optional.
With these two windows, you can connect doubly to your server.
First, in the telnet window, you telnet to your server and login.
Second, in the browser window, you open the browser to the same server.
Before you do this, you should have the server's system administrator
establish an account on the server which is properly protected (from hackers)
and whose address can be published.
My personal address is:
Depending on the server running on your system, a user may or may not
be able to open your site with a simple
Usually, one has a home page or a `Welcome' page.
The so-called home page, is the first place that every user should come
to when `opening' his/her viewer to your location.
This means that you must create an HTML page, usually called `index.html',
which will have links to all you other items (questions, etc.).
We are going to create the simplest of home pages here, which you should
type into a file:
<HEAD>
<H1>How to Write Computer Assisted Testing Question</H1>
</HEAD>
<BODY>
<br>
<H2>Using CGI.pm to write Perl `Programs'</H2>
<!- start of list of Chapters and/or Subjects ->
<H3>Tentative Table of Contents</H3>
<UL>
<LI><A HREF="question1.pl">Question 1</A>
</UL>
</BODY>
If you save the above text in a file known as `index.html' in the public_html directory of
the server under your account (my account here `cdavid'), then when a user
uses the URL:
http://chemphys.uconn.edu/~cdavid/
the user will see the code you have typed in appear in the user's browser's window.
The server's account (`cdavid' in my case) was set up with a `public_html' sub-directory.
If it wasn't created, you have to do it, i.e., create such a sub-directory (vide infra).
One small warning. If you click on the `Test the above html code' box
below, you will find that
the question, Question 1, is not operative, and when you click on
it you will get an error.
A perl program can not reside in the public_html subdirectory,
as it is executable, and must reside in the cgi-bin (or lower on
some servers) subdirectory (vide infra).
But that is getting ahead of our knowledge base.
Test the above html code.
Continue on to next section (prelim2).
Return to the main book TOC.