#!/usr/local/bin/perl

# by R. Bradley (October 1996)


$OUTFILE = "/users/skiena.dir/algorith/comments";

BEGIN {
	unshift(@INC,'/users/skiena.dir/algorith/public_html/cgi-bin');
}
use CGI;

$query = new CGI ();
$host=$query->remote_host();     # remote user's host name
$ident=$query->remote_ident();   # remote user's username

print <<EOF;
Content-type:  text/html

<HTML><HEAD><TITLE>Algorithm Comments Reponse</TITLE></HEAD>
<BODY BGCOLOR=#ffffff>
EOF
	;
open (OUTFILE, ">> $OUTFILE") || &fail;

sub fail
{
print <<EOX;
<H1>Unsuccessful Submission</H1><P>
<HR>
We are sorry that we were unable to 
process your comment submission at this time.
Please try again in the near future.<P>
<HR size=3>
<A HREF="mailto:algorith\@cs.sunysb.edu">Send us Mail</A>
<BR><A HREF="http://www.cs.sunysb.edu/~algorith/index.html">Go to Main Page</A>

</BODY></HTML>
EOX
	;
	 exit(0);
}

@names= $query->param;           # form input from CGI
while (@names)
{
   $name = shift (@names);
   $val = $query->param($name);
   printf OUTFILE "$name=$val\n";
}


print OUTFILE "#-----------------#\n";  # record termination marker
close OUTFILE;

print <<EOT;
<H1>Successful Comment Submission</H1><P>
<HR>
Your comment information has been entered into our database.
Your information will be available to other users in the next
day or so.
Thank you for your interest and support.
<HR size=3>
<A HREF="mailto:algorith\@cs.sunysb.edu">Send us Mail</A>
<BR><A HREF="http://www.cs.sunysb.edu/~algorith/index.html">Go to Main Page</A>

</BODY></HTML>
EOT
	;
exit(0);
