NOTE: When you are testing a form, do not use the option to load a local page, that many WWW clients offer (in Netscape this is the "Open File" option under the "File" menu). This option will load your form page properly but will cause an error when you try to Submit the form. The problem occurs because this form of loading bypasses MacHTTP, and loads the file directly from disk to your client software. Since MacHTTP wasn't involved, it won't know to send an AppleEvent to the CGI application when the form is submitted. A sure sign that you are using the wrong method to view your form is if the URL has "file:" at the start - that means the file is on your local hard disk.
Let's look at an example:
Assume that you have MacHTTP in a folder on the root of your hard disk. The path to MacHTTP would be "BigDisk:HTTP Server:MacHTTP". Now you have a folder on your site called "Testing" that contains a form page, "UserForm.html". The full path to the form page is "BigDisk:HTTP Server:Testing:UserForm.html". You will never use this path, though. The only path that matters here is the path relative to MacHTTP. This relative path is "/Testing/UserForm.html".
NOTE: The Macintosh OS uses colons (:) to delimit folders in a path. URL's, however, use the slash (/) character instead. This is because the first http servers ran on Unix machines, which use the slash character to delimit folders (directories) in a path. This is the way you will be writing paths for all of your HTML pages. In addition, this method doesn't allow any spaces in the path - you must use "%20" to indicate a space. It is best to avoid spaces in file or folder names under MacHTTP.
Back to the example:
Now, suppose you want to put the CGI application that processes this form into another folder within the "Testing" folder where you will keep all of your CGI's. The full path to this folder is "BigDisk:HTTP Server:Testing:CGI:". For the CGI application that will process this form, named "FormProcessor.cgi", the path relative to MacHTTP is "/Testing/CGI/FormProcessor.cgi".
Now everything's in place. In your form page, the element that marks the beginning of the form needs to specify where the CGI application is that will be used to process the form. If you use a path relative to MacHTTP ("/Testing/CGI/FormProcessor.cgi", as listed above) then the line would look as follows:
<form action="/Testing/CGI/FormProcessor.cgi" method=post>If, on the other hand, you choose to use a path relative to the form itself, the line will look like:
<form action="CGI/FormProcessor.cgi" method=post>Either one is acceptable, and the second method provides a little more portability so it might be preferable.