IMPLEMENTING WEB WEAVER'S CGI SCRIPT FOR PROCESSING YOUR FORM

Unless you are running your own Web server (most of you are not), then you CANNOT test your form from your local computer. You must upload it and the CGI script to your Internet Service Provider's (ISP) server and then test it on the Web.

There are a few things you must do to make your Form and CGI script work correctly. First we'll try using the default settings in the CGI script to see if the work on your ISP's server.
Follow these steps:

  1. Make sure your ISP allows custom CGI scripts (made by customers) to reside on their server. Sometimes ISPs don't want CGI scripts other than their own on their server. They may be afraid of security risks.

  2. After you have completed the HTML form Web page, upload it (as ASCII format) to your Web disk space provided by your ISP.

  3. Upload the file formmail.cgi found in the Web Weaver FORMS directory (as ASCII format) to your Web disk space provided by your ISP. Make sure this file is in the same directory as your HTML form Web page on your ISP's Web disk space.

  4. Now we'll explain file permissions to you. Web servers have permissions for each file on their hard disks so different users can have access to files and others cannot. These servers have the capability to restrict users from reading files, writing to files, or executing files. So there are 3 restrictions for files: read(4), write(2), and execute(1). There are also 3 levels of user that can be restricted: user(you), group, and world.

    What we need to set for our CGI script are permissions that allow everyone to read and execute the CGI script, but not write to it. Using your FTP client you can specify the permissions by selecting the file and select permissions from the pull-down menus or the right-click pop-up menu. It may give you a box that lets you set permissions easily. Do this by selecting the following:
    User: Read, write, and execute
    Group: Read and Execute
    World: Read and Execute

    If you must type in the UNIX command to change permissions then the syntax would be:

    chmod formmail.cgi 755


    where the numbers 755 represent the permissions. Here's how we got the numbers. Adding the numbers together for read and execute permissions results in 4+1=5. You want to give yourself all permissions, so that would be 4+2+1=7. So, to represent these permissions for user, group, world we would have the following permission numbers: 755.

  5. Now test the Form online and see if it works.

If you get a server error or the form didn't work, then you may have to change a few things in the CGI script.

Follow these steps carefully:

A) Check with your ISP and ask them the correct path of the program called PERL on their system. The first line in the formmail.cgi program calls the PERL program to compile and interpret the formmail.cgi script. The default path is:

/usr/bin/perl

and the first line in the formmail.cgi script reads:

#!/usr/bin/perl

If the path is different on your ISP's server, then you must update the first line of formmail.cgi to reflect the correct path. Open formmail.cgi in Web Weaver and edit the first line. Do not save the file. You must export it. Select Export-Save as UNIX file from the File menu in Web Weaver. Then export/save it as the same name: formmail.cgi. The exporting as a UNIX file is crucial for the script to work.

B) Now upload the formmail.cgi script and reset the permissions as described in step 4 above. Test the online form. If it still does not work, go on to step C.

C) Check with your ISP and ask them the correct path of the mail program called 'sendmail' on their system. The 31st line in the formmail.cgi program calls the sendmail program. The default path of the sendmail program on most systems is:

/usr/lib/sendmail

You should edit the formmail.cgi script to reflect the correct path of the send mail program. The 31st line in formmail.cgi reads:

$mailprog = '/usr/lib/sendmail';

Remember to Export it from Web Weaver, upload it, and set permissions correctly as described above. Test the online form again to see if it works.

If it doesn't contact your ISP for further troubleshooting. We cannot determine the problem since we don't have access to your ISP's settings or server.