sisTR

Pro

Current Path : /services/http/users/r/rickfdez/
Upload File :
Current File : /services/http/users/r/rickfdez/survey.pl

#!/usr/local/bin/perl
#Includes cgi-lib file; if cgi-lib doesn't exist, returns malformed
#header error
do "cgi-lib.pl" || die "Fatal Error: Can't load cgi library";
#calls the subroutine in the cgi-lib.pl library
#to read in the variables from the form and set them up
#as key=value pairs in the array @in
&ReadParse;
#tells http server incoming data is text html
print "Content-type: text/html\n\n";
#returns acknowledgment of mail submission and provides a link back
print "<HTML>";
print "<HEAD><TITLE>Thank You\!</TITLE>";
print "</HEAD><BODY>";
print "<H2>Thank you\!</H2>";
print "<P>";
print "Your entry has been\n";
print "sent to our guest book.\n";
print "<HR>";
print "<H3>Back to the <A HREF=\"/index.html\">";
print "Front Page</A></H3>";
print "</BODY></HTML>";
#assigns process id to $pid
$pid=$$;
#opens up comment file for writing
open(COMMENTSFILE,">/tmp/my_comment.$pid");
#enter the form data into the file to be mailed
print COMMENTSFILE "GUEST BOOK ENTRY\n";
print COMMENTSFILE "- - - - - - - - - - - - - - - - - -\n";
print COMMENTSFILE "optional information:\n";
print COMMENTSFILE "      Name:  $in{'firstname'} $in{'lastname'}\n";
print COMMENTSFILE "   Address:  $in{'address1'}\n";
print COMMENTSFILE "             $in{'address2'}\n";
print COMMENTSFILE "             $in{'city'} $in{'state'} $in{'zip'}\n";
print COMMENTSFILE "     Phone:  $in{'areacode'} in{'prefix'} $in{'number'}\n";
print COMMENTSFILE "     Email:  $in{'from'}\n";
print COMMENTSFILE "  Comments:  $in{'subject'} $in{'body'}\n";
print COMMENTSFILE "    Visit?:  $in{'visit'} $in{'visitdate'}\n";
print COMMENTSFILE "     Chat?:  $in{'chat'} $in{'ircdate'}\n";
print COMMENTSFILE "    Visit?:  $in{'maillist'}\n";
print COMMENTSFILE "    Visit?:  $in{'lodging'} $in{'staydate'}\n";
print COMMENTSFILE;
#close out file to be mailed
close COMMENTSFILE;
#sends comment file as mail to user
$command="mail ricklaw@uclink.berkeley.edu < /tmp/my_comment.$pid";
system($command);
#erases temp file
unlink("/tmp/my_comment.$pid");

Copyright 2K16 - 2K18 Indonesian Hacker Rulez
Copyright sisTR