#! /Perl/bin/perl $|=1; use diagnostics; use vars; use CGI qw(:standard); use Win32::OLE; $q = new CGI; # The following accepts the data from the form print"Content-type: text/html\n\n"; $LastName = param('LastName'); # $FirstName = param('FirstName'); # $MiddleName = param('MiddleName'); # $Email_address = param('Email_address'); # $Area = param('Area'); # $Prefix = param('Prefix'); # $Number = param('Number'); # $Address = param('Address'); # $City = param('City'); # $State = param('State'); # $Zip = param('Zip'); # $Code = param('Code'); # $Grad = param('Grad'); # $HighSchool = param('HighSchool'); # $tmpfile = "../../Temp/$$.htm"; $dir = "../../Temp/RRX"; $dirfile = ""; $filexist = 0; @dirfiles = (); $file = "seminar.txt"; $Phone = join('-',$Area,$Prefix,$Number); @seminarfile = join('^',$LastName,$FirstName,$MiddleName,$Email_address, $Phone,$Address,$City,$State,$Zip,$Code,$Grad,$HighSchool); send_win_mail(); } ############# sends mail to persons ########################################## sub send_win_mail { my $from = $q->param('Email_address'); my $to = ("$Email_address"); my $subject = qq(Summer Seminar '04 Information Request); my $date = localtime(time); my $mailbody = "$FirstName $LastName submitted an Summer Seminar Application Request on $date: \n\n"; my $AttachFile = "$tmpfile"; my $objMail = Win32::OLE->new("CDONTS.Newmail"); $objMail->Send($from,$to,$subject,$mailbody,$AttachFile); undef $objMail; unlink($tmpfile) || die "Can't delete $tmpfile: $!"; # Deletes the file created in /tmp/html exit(0); } sub email_msg { open(OUT, ">$tmpfile") || die "Can't write $tmpfile: $!\n "; print OUT "test"; close(OUT); } ################# creates new file or adds to existing file ############### sub add{ if($filexist == 1) { open(IN, "< $dir/$file") or die "Can't open input file $file: $!\n"; chomp(@filearray = ); close(IN); push(@filearray, @seminarfile); } elsif($filexist == 0) {push(@filearray, @seminarfile)} open(OUT, "> $dir/$file") or die "Can't write to $file: $!\n"; foreach $line(@filearray) { chomp $line; print OUT "$line\n"; } close(OUT); }