CGI PERL on Web 4 Students
Here are the things you need to do to make PERL scripts work on Web4Students:
- Create your form. See My First Form
- Point it to your script with the following code -- <FORM METHOD="POST"
ACTION ="http://web4students.montgomerycollege.edu/courses/Fall2003/WDCE/CMP05624654/studentNN/cgi-bin/tl_form.pl"
name="NNBook"> The information
in red is specific to your student account. Substitute your account information
as appropriate in the <form action="">
tag in your version of tlform.html
- Create your PERL script. See tl_form.pl for a sample
script designed to work with the Web 4 Students Apache (UNIX) server. You
can use this script and modify it to fit your form variable names
- Upload your PERL script to your cgi-bin folder on your web site. Be sure
to check the radio button "ASCII",
not "Binary" on your FTP softwre in loading your script. This is an ASCII
text document.
- Upload the Perl library, cgi-lib.pl, to your
cgi-bin folder. Be sure to check the radio button "ASCII", not "Binary"
on your FTP softwre in loading your script. This is an ASCII text document.
- Upload your log file, NNBook.txt to your root
folder on your web site. Be sure to check the radio button "ASCII",
not "Binary" on your FTP softwre in loading your log file. This is an
ASCII text document.
Permissions: It is now extremely important that you change the "permissions" on your CGI-PERL library documents so that they will work.
Permissions were designed for UNIX servers. Permissions give various rights of access to various users. The three types of users are known as Owner, Group, and Other. The three types of permissions are the permissions to Read a file, Write to a file, and Execute a file.
You set permissions as follows:
- Upload your file using FTP
- Within the right window of WS_FTP, or other FTP software (the server window), select the file.
- Right click to bring up a context-sensitive menu.
- Select "chmod(Unix)", which means "change modes."
- A dialog box will appear. Change the modes based on the table below. You do not need to change the modes for your form, located in the root directory.
- You may need to execute the last step twice. The Web4Students server has been a little "buggy," and the permission changes do not always "take" the first time you change them.
|
|
|
|
|
|
|
|
|
|
|
| |
Owner |
Group |
Other |
| File Name |
Directory |
R |
W |
E |
R |
W |
E |
R |
W |
E |
| cgi-lib.pl |
CGI-BIN |
X |
X |
X |
X |
|
X |
X |
|
X |
| count.txt |
CGI-BIN |
X |
X |
X |
X |
X |
|
X |
X |
|
| tlform.html |
root |
|
|
|
|
|
|
|
|
|
| img_counter.cgi |
CGI-BIN |
X |
X |
X |
X |
|
X |
X |
|
X |
| tl_form.pl |
CGI-BIN |
X |
X |
X |
X |
|
X |
X |
|
X |
NNbook.txt NN=Your initials |
root |
X |
X |
|
X |
X |
|
X |
X |
|
| tlform.css |
root |
|
|
|
|
|
|
|
|
|