docs.roxen.comView this page in a printer friendly mode
DocsRoxenWebServer 3.4Web Developer ManualScript
Copyright  2006, Roxen Internet Software
Suggestions, comments & compliments
manuals@roxen.com
 DEMO  DOCS  PIKE
 COMMUNITY  DOWNLOAD
www.roxen.com



CGI
Pike
Perl
Java
Javascript

CGI

Any script language for which there is a script interpreter installed in your system (at a location where Roxen can access it) can be run as a CGI (Common Gateway Interface) script. The traditional form for this is to write them as Unix scripts, with a first line of


#! /path/to/the/interpreter

followed by the actual script. An example in Perl (assuming the Perl interpreter is installed as /usr/bin/perl, which is the common place for it on many Unix systems) might look like this:


#! /usr/bin/perl print "Content-type: text/html\r\n"; print
"\r\n"; print "Current time according to the server: ",
scalar(localtime), "\n";

On Unix, we can use the traditional login shell as a script interpreter, if we want to:


#! /bin/sh
echo 'Content-type: text/html\r'
echo '\r'
echo "Current time according to the server: `date`"

See the CGI section in the System Developer Manual for more information about CGI scripts.