path.cgi
#!/usr/bin/perl if ($ENV{'REQUEST_METHOD'} eq 'GET') { @pairs = split(/&/, $ENV{'QUERY_STRING'}); } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); if ($ENV{'QUERY_STRING'}) { @getpairs =split(/&/, $ENV{'QUERY_STRING'}); push(@pairs,@getpairs); } } else { print "Content-type: text/html\n\n"; print "<P>Use Post or Get"; } print "Set-Cookie:language=$formdata{'language'}; expires=Thu, 31-Dec-1998 00:00:00 GMT; domain=help.setgetweb.com; path=/help\n"; print "Content-type: text/html\n\n"; print "<HTML><HEAD><title>Thanks for choosing!</title></HEAD><BODY>"; print "You chose $formdata{'language'}. Next time you visit, I'll greet you accordingly.";