#!/usr/local/bin/perl
################
|
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.
############################
# create new board (check) # ############################ : : if ($data{'name'} eq "") {$redo1 = "ID is missing.<br>";} : |
"sendmail"
You can change mail notices, too. Perl utilizing "sendmail" sends you and the new user mails when a new board is created.
#############################
# create new board (action) # ############################# : : ### mail confirmation start ### ## new to user ## : : To: $data{'mail'} From: $addrss Reply-to: $addrss Subject: Welcome new Board-Master (keep this record) Dear new Board-Master, Just in case you forget your registration. Your ID: $data{'name'}
Administrative work (deleting inappropriate articles) can be made from
To modify or delete your MessageBoard
Thank you.
User ID: $data{'name'}
|
####################
# delete old board # #################### : : ### mail confirmation start ### : : ## delete to user ## : : To: $mail From: $addrss Reply-to: $addrss Subject: Your message-board has been deleted Dear $name, Your message-board
Thanks
:
|
If you do not want to send mail notices, you can delete above lines from ###mail confirmation start### to ###mail confirmation end### for either or both of "create new board (action)" and "delete old board". Or you can stop each mail ## new to user ##, ## new to admin ##, ## delete to user ## or ## delete to admin ## individually by deleting lines under each heading.
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.