# # Program Name: sample # Description: A simple program to demonstrate the basics of the AuroraCGI # programming environment # Date released: 15 August 1996 # Author: Peter Murray, Library Information Technologies, CWRU # # All CGIs need to output the content-type of "text/html" followed by a # blank line. print "Content-type: text/html\n\n"; # # First, print the Aurora low-profile banner graphic with a page title of # "Sample AuroraCGI page". The rest of the parameters are not used. print AURORAheader("Sample AuroraCGI page"); # # Now, just say "hello world!" Note that we also have access to the # traditional environment variables that NCSA's 'httpd' server gives us, # including REMOTE_HOST. print "

Hello world!

\n"; print "

I see you are coming from $ENV{'REMOTE_HOST'}.

\n"; print "

People who have run this program include:

\n"; # # Open up a file and print it's contents. The file is /cgi/out/sample.txt # (from your home directory, in the directory "cgi", in the directory "out", # the file "sample.txt"). ropen(TEST,"< /cgi/out/sample.txt") || print "

Cannot open sample.txt file: $!

"; while() { print; } close(TEST); # # Open the file again for appending. Note that we do not need the path here. # The file will be in the /cgi/out directory, we have no choice. $timeString = localtime(); ropen(TEST,">>sample.txt"); print TEST "Run from $ENV{'REMOTE_HOST'} at time stamp $timeString
\n"; close(TEST); # # Print the Aurora Footer information print AURORAfooter("AuroraCGI\@lit.cwru.edu"); # # Send a mail message saying that the program was run mail('pem@po.cwru.edu','test message','The AuroraCGI program was run from '.$ENV{'REMOTE_HOST'}); # # Note: There is no "exit" call here. That is one of the "restricted # operators".