:
Custom CGI Information |
Here are some details you will want to know for creating your own CGI scripts.
Scripts start with the following lines:
- For Perl:
#!/usr/local/bin/perlFor CSH:
#!/bin/csh
For SH:
#!/bin/sh
Sendmail is located at
- /bin/sendmail
Included in a Perl CGI, it looks like this:
$address = 'bob@widget.com';
open (MAIL,"| /bin/sendmail -fyourname\@speedsoft.com $address");
print MAIL "Reply-to: yourname\@speedsoft.com\n";
print MAIL "Subject: Whatever\n\n";
print MAIL "Hi, how are you doing?\n";
close (MAIL);
The "Reply-to" field is optional. -f specifies who the message is from and is
required. Be sure to escape the (at) sign with a backslash.
Script
filename extensions
- Your scripts can have any filename extension you want if they are
located in your cgi-bin directory. If they are located elsewhere, use
either of the two filename extensions:
.pl
.cgi
-
Call your scripts from your web page with
-
http://www.YOURDOMAIN/cgi-bin/scriptname
-- or for non-virtual hosting clients
--
http://www.speedsoft.com/YOURDIR/cgi-bin/scriptname
Environment Variables
- Run "http://YOURDOMAIN/cgi-bin/envhtml.pl" to see what environment variables
are available.
-
File Path Info
- Document Root for your account is:
/usr/local/etc/httpd/vhosts/yourdirectory/
-- or for non-virtual hosting clients --
/usr/local/etc/httpd/htdocs/yourdirectory/
|