#!/usr/local/bin/perl # This program sends an e-mail message with clients hostname # and client software whenver the page is accessed. # The read in file..is a normal html file. $pageowner = "epperson\@colorado.edu"; $sender = "webmoniter\@colorado.edu"; $filename = "./Resume"; ############################################################## # Open up e-mail message, send to pageowner from forms user. open (MESSAGE,"| /usr/lib/sendmail -f $sender $pageowner"); ############################################################## # Format and write the email message. print MESSAGE "Subject: Resume Viewing\n\n"; print MESSAGE "----------- begin message -----------\n"; print MESSAGE "Your resume has been viewed from:\n\n"; print MESSAGE "Remote Host: ", $ENV{'REMOTE_ADDR'},"\n"; print MESSAGE "Client Browser: ", $ENV{'HTTP_USER_AGENT'},"\n"; print MESSAGE "E-mail Address: ", $ENV{'HTTP_FROM'},"\n"; print MESSAGE "Referer: ", $ENV{'HTTP_REFERER'},"\n"; print MESSAGE "User: ", $ENV{'REMOTE_USER'},"\n"; print MESSAGE "Ident: ", $ENV{'REMOTE_IDENT'},"\n\n"; print MESSAGE "----------- end of message ----------\n"; close (MESSAGE); # Initialize html and read in file. print "Content-type: text/html\n\n"; open(RESUME,"$filename") || die "Sorry, I could not create /tmp/dataplace\n"; while () { chop; print "$_\n"; } close(RESUME);