![]() |
|
||||||||||
General script information
The following general information and guidelines will assist you in successfully using scripts in your Web pages.
Item Path Sendmail /usr/sbin/sendmail Perl5 /usr/bin/perl Date /bin/date Java /usr/bin/java Python /usr/bin/python Domain path home/[domainname]/www/ Cgi-bin /www/[domainname]/cgi-bin
System paths
If a script calls another file within your account, but the script does NOT require a URL, you need to use the system path. Instead of using the absolute path to your home directory, you should instead use the DOCUMENT_ROOT environment variable ($ENV{DOCUMENT_ROOT} in Perl) to determine the path of your files or programs within a script. For example:
- Change this: /www23/web/yourid/data/fact.html
- To this: $ENV{DOCUMENT_ROOT}/data/fact.html
The system path to the sendmail program on our UNIX servers is /usr/lib/sendmail.
The system path to the date command on our UNIX servers is /sbin/date.
Calling CGI scripts
When calling CGI scripts from a Web page, you must use the alias for the /cgi-bin directory. The alias is "cgi-[domainname]". For example, if your domain name is sampledomain.com, then the /cgi-bin alias is cgi-sampledomain. Note that ".com" is not included. The action attribute of your form element would be action="/cgi-sampledomain/programname."
You can put your CGI programs anywhere outside of the /cgi-bin directory. If you do, the program name must end in ".cgi".
To call a CGI script securely, the script must be placed in the /cgi-bin directory and the URL must reference your secure server (which is listed in SiteEasy). For example:
https://idXX.securedata.net/cgi-[domainname]/FormMail.pl
https://sslXX.securedata.net/cgi-[domainname]/Count.cgi
Example code
print"Content-type: text/html\n\n";
#The html output
print "<html>\n";
print "<head><title>Hello World !!!</title></head>\n";
print "<body>\n";
print "<h2>Hello World!!!</h2>\n";
print "</body>\n";
print "</html>\n";