#!/usr/local/bin/perl -w use CGI; my $query = new CGI ($ENV{'QUERY_STRING'}); my $number = $query -> param ('number'); if ($number eq "") { queryerr (\%ENV); } if ($number =~ /^\./ || $fname =~ /\//) { queryerr (\%ENV); } &generate_html; sub generate_html { print "Content-type: text/html\n\n"; print <
Acknowledgement and Disclaimer
You and your institution are responsible for assuring that any publication including World Wide Web pages developed under or based on NSF support of your project includes an acknowledgment of that support in the following terms:
    "This material is based upon work supported by the National Science Foundation under Grant No. $number."
You and your institution are responsible for assuring that, in any publication including World Wide Web pages which contains material based on or developed under your award (other than a scientific article or paper appearing in a scientific, technical, or professional journal), this acknowledgement is accompanied by the following disclaimer:
    "Any opinions, findings and conclusions or recomendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation (NSF)."
NSF LOGO

For more information about National Science Foundation, visit the NSF site.

END_OF_HTML } sub queryerr { my $env = shift; my $query = $$env{'QUERY_STRING'}; my $host = $$env{'REMOTE_HOST'}; my $addr = $$env{'REMOTE_ADDR'}; print "Content-type: text/html Invalid Query A valid document was not specified. "; # Write log entry open TIMESTR, "date|"; $curtime = ; chomp ($curtime); close TIMESTR; open LOGFILE, ">>log/error.log"; print LOGFILE "Bad query $query at $curtime from $host ($addr).\n"; close LOGFILE; # Error in Apache weblog. die "Invalid query $ENV{'QUERY_STRING'}"; }