- Web-Hosting Support
- Where to Find This Script
- Where and How to Upload the Script
- Configuration Guide
- Uploading and File Formats
- Your Contact Form
Uploading and File Formats
The great majority of web servers that you will deal with are *nix of some sort, and Windows files handle the end of lines differently than *nix does. That's why you'll usually see lots of ^M (Ctrl+M) characters in anything created on a DOS/Windows box and uploaded to a *nix server instead of created in a *nix text editor such as pico or vi. A script created or edited on a Windows system must be converted to *nix before it will run correctly on a *nix box. The easiest way to handle this from Windows is to use ASCII file transfer mode, not binary or Auto, in your FTP program.
NOTE
*nix is case sensitive. The name of the script must match the filename pointed to in the form action line on your contact page HTML, or it will not work. For example, formmail.pl is not the same as FormMail.pl or Formmail.pl or formmail.PL.
After the script file has been uploaded, you need to change the file permissions so that the public will have the access required to make the script work. If you're using Telnet to directly access your account, instead of 644 (everyone read-only except owner), the file needs to be readable and executable by the public. A script is a program that the browser executes, but it should not be writeable by the public.
If you're using WS_FTP, create the cgi-bin (or whatever the provider says it ought to be calledcgi is a likely alternate) by pushing the MkDir screen button on the right of the screen, as shown in Figure 2.
Figure 2 Making a directory in WS_FTP.
Fill in the name of the script directory in the Input prompt. You can get this information from your provider.
Right-click the file and select chmod UNIX from the menu. Then set it as shown in Figure 3.
Figure 3 Setting file permissions.
If you have Telnet access, create a cgi-bin directory from the root directory of your web site:
mkdir [script directory name] [PROVIDER]
Then upload the script to it and change the permissions:
chmod 755 FormMail.pl
If you modify or replace the script file, remember to do the chmod command again on it.
Upload the contact form page as you would anything else to your web site. You'll see below that the full path to the script is specified in the part of the HTML page that calls it. That means that you can put it anywhere on the site.