CGI Frequently Asked Questions ( With Answers )
Q: How do I access my CGI scripts?
A: In an HTML FORM, you would use the following HTML tags:
<FORM METHOD=[get or post] ACTION="/[your user name]-cgi-bin/[scriptname]">
To call on a CGI program as a link, you would use the following tags:
<A HREF="/[your user name]-cgi-bin/[scriptname]">
Replace [your user name] with your login name (ie: "kevinr").
Q: My PERL script doesn't work!
A: To beta-test your script, use "perl -c [scriptname]". PERL will output some
errors. It's not the _exact_ errors, but it will give you an idea of where the
problems might be.
Some of the most common errors are forgetting the ";" at the end of a function,
forgetting the "&" at the beginning of a custom function, or forgetting to put
two newlines ("\n") after a content-type. The correct string to output if you
want to use HTML tags is
print "Content-type: text/html\n\n";
This _must_ preceede any HTML tags!!
Q: My PERL Script still doesn't work!!!
A: If you are using a non-Unix machine, chances are you machine uses different
"end-of-line" strings. Upload your CGI script to SmartNet, then use "pico" to
edit the file. Pico will remove any foreign "end-of-life" characters and
replace them with something Unix/Linux will understand.
Q: My PERL script STILL doesn't work!!!!!!
A: Email our WebMaster and explain the problem you are having.
He will need your username and which server (Smarty, Smarty2, or Navigator)
your CGI scripts are on.
Q: How do I use ImageMaps in my pages?
A: You will actually need three different files:
- A MAP file, used to tell the ImageMap program where to take the user after
they click on different parts of the picture.
- A Picture, in JPEG or GIF format.
- An HTML file that calls on the ImageMap program as follows:
"<A HREF="/cgi-bin/imagemap/~[your user name]/[your map file]">
<IMG SRC="[ the picture ]" ISMAP BORDER=0></A>"
More information on ImageMaps is available through our web site at this
address:
http://www.smart.net/help/how-to/imagemap.html
Q: How do I install the public guestbook script?
A: Enter "guestbook" at any Unix prompt.
Q: How do I install the SmartCounter on my pages?
A: Enter "counter" at any Unix prompt. For full details on the different options
the counter has, visit
http://web.smart.net/help/how-to/counter.html
Technical Support: support@smart.net
Billing: billing@smart.net
Webmaster: webmaster@smart.net