What path should I use to reference my CGI script?


It is always best to reference scripts, as well as HTMLs, relative to your home directory. For example:

form method="post" action="my-script.cgi"
form method="post" action="my-bin-dir/my-script.cgi"
Please note that there is no forward slash at the beginning of the path.

There are times when a script requires the absolute path to a file. What that path is depends on the machine you are on and the kind of account you have. If you have a personal web account, use this:

/var/home/<FIRST LETTER OF USERNAME>/<SECOND LETTER OF USERNAME>/username/
So for example if your username is "bobdobbs", and you're specifying the path to a fil e called "myscript.cgi" in your "public_html" directory, the path would be so:
/var/home/b/o/bobdobbs/public_html/myscript.cgi
If you have a Virtual Web Hosting account (with your own domain name, à la "www.m ydomain.com"), then the path is simply:
/var/domain/<YOUR DOMAIN NAME>/
(Make sure to include the "www"). The forward slash is required in both of these cases as it needs to reference the machine's root directory.


A service of zNET Internet Services