Before this page
See the advice for a novice first where you make compulsory changes on the first line (path) and the basic set up. You may make any optional changes but please do so after you confirm that the default CGI works.

You may change other basic setting and HTML or a part of HTML (see the advice for a little learnt).

A little more than HTML
Now you can change something a little more than HTML.. Open link.cgi
###########
# add url #
###########
      :
      :
### add new link ###
     :
     :
$thank = "URL have been successfully added.";
$mlsub = "New link on LazyLinksLimited";
     :
     :
$thank = "CGI couldn't find appropriate group. It may be fixed by the webmaster.";
$mlsub = "LazyLinksLimited couldn't find group";
The upper two lines set the message to the guest and the notice to yourself when the CGI works right. The lower two, when the link is misplaced. You may change the wording in the double quotes. $thank is to be the part of thank you message, which is a HTML document, to the guest. $mlsub is the subject of the mail to you.

"sendmail"
You can change mail notices, too.
###########
# add url #
###########
     :
     :
### mail notice ###
open (MAIL, "|$smpath -t -oi");
print MAIL <<"LINK_NOTICE";
To: $addrss
Subject: $mlsub

group: $data{'group'}
link: $data{'url'}
title: $data{'title'}
$data{'descript'}

by $data{'name'} <$data{'email'}>
LINK_NOTICE

close MAIL;

To and Subject are standard mail headers. You can have Cc or Bcc or whatever you like here as far as they conform to the mail protocols. Please note, you must have one blank line between the mail head and body to separate them. In the above case, a blank line below Subject:. You can change the body any way you like. You may not have the body at all. Keep the blank line after the head and it can reach you.

Or if "sendmail" is not available, you may have # at the head of $smpath and delete relevant fields and words and javascript in add.html
     :
     :
if (document.link.email.value == "") {msg+="Just between you and me, tell me your email address :-) "}
else {
if (document.link.email.value.indexOf("@",0) < 0) {msg+="Your mail address seems wrong! It must have @ in it. "}
};

     :
     :
<- This is a part of add.html JavaScript. You find it between <script language="JavaScript"> and </script> on the head of the page. If you do not know JavaScript, do not change here or any part of the JavaScript. If you know JavaScript, these lines check if "name" and "email" fields of <FORM> are filled. Delete these lines if you do not need them.
and
     :
     :
</TD><TD>
Name <INPUT type=text name="name" maxlength=60><BR>
Email <INPUT type=text name="email" maxlength=80>

     :
(Your Name/Email address are for the administrative purpose. They will not appear on the link page.)
     :
     :
<- This is a part of add.html <BODY>. Since name and email address do not appear on the link page but send to you by an email, if you can not use "sendmail", bothering your guest by asking these questions does not make sense. You may delete these lines but you do so only if you know JavaScript and can delete related lines above.
As these fields and javascript are useless and misleading if "sendmail" is off, you may delete them from add.html. And if you delete, you delete both field and related javascript. Deleting only one of them can be more confusing and may cause an error.

You may have the name and the email address shown on the link page instead of them sent to you by mail. (See how to change the way information is arranged.)


If you are testing your CGI before uploading it to the server, you need "Web-Server Program", "Perl" and "Browser." I think you already have a browser, IE or NetscapeNavigator or something. A CGI does not work without properly placed at a server. (Though you can check its syntax by Perl alone without setting up server. A script could malfunction even if syntax is ok.)

I assume you are not really starting server business. You are just testing CGI and never make outside connection while server program is running. Then you are the only user and you can set everything open and accessible (permission 777, an easy choice). If in doubt, disconnect the telephone line. If your computer is connected to a local-network, or intra-net and can not be, or should not be disconnected, ask your network administrator first. There may be something you can do technically but prohibited by regulations. Depend on how you ask, the system administrator can be your asset or liability.

Latest Mac and Windows come with a web-server program. Consult with the manual. Find Personal WebSharing (for Mac) or Microsoft Personal Web Server (for Windows). You may download much fancier program from internet. A lot of free-(or share-)wares are availably there.

I myself used Mac with Personal WebSharing. TCP/IP (you find it in AppleMenu if you never modified the system) setting is: select LocalTalk (or AppleTalk or MacIP); IP address is manually sat 192.168.1.1; Subnet Mask (or router) is 255.255.255.0; Gateway is 0.0.0.0. Using AppleTalk means AppleTalk must be on. At least it works for me.

Next, you run a server program. Select a folder (or directory) to be shared via WebSharing. It can be advised that the folder is placed directly under a hard-disk. (Apple says after 5th subdirectory it may malfunction.) You may select your homepage, too. I hope all this wouldn't confuse you. I needed one week till the server up and running. Check internet, there are many web-sites advising this or that.

Run a browser and type "http://192.168.1.1/" (or your IP address) in the location window. If everything is ok, you see the listing of the folders and files in the folder you've selected for WebSharing or if you have a homepage there, the homepage. Depend on setting, and if you do not have the homepage, you may be warned "file not found" etc. It's ok. You add a name of file which you know there. For example "http://192.168.1.1/file_name.html" etc. But if you see the message "the network connection was refused by server 192.168.1.1", something must be still wrong.

Once you make your computer virtual server, have Perl somewhere within it (within the directory selected to be the server). You can download the latest Perl for your O/S; the first place to see is http://www.perl.com/CPAN/. Set the "Path" of the CGI script accordingly. This is must. Other changes are optional. And even if you want to make optional change, see if the CGI works in its default setting at first.