Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!../perl/bin/perl.exe -Tw
- my $query_string = '';
- #Get the input
- if ($ENV{REQUEST_METHOD} eq 'POST') {
- read(STDIN, $query_string, $ENV{CONTENT_LENGTH});
- } else {
- $query_string = $ENV{QUERY_STRING};
- }
- # Split the name-value pairs
- @pairs = split(/&/, $query_string);
- foreach $pair (@pairs) {
- ($name, $value) = split(/=/, $pair);
- # Making the input English. And removing unwanted things
- $value =~ tr/+/ /;
- $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
- $FORM{$name} = $value;
- }
- # Give output
- print "Content-type: text/html\n\n";
- open(ECHO, '| echo 1') or print 'hi';
- #exec("../apache/bin/sendEmail-v156/sendEmail.exe -t hacevedo3\@gmail.com -f ibolmo\@gmail.com -u 'Subject: Feedback from 1 at 2' -m 'The user wrote: 3' -s smtp.gmail.com -o tls=yes -xu tempsendemail\@gmail.com -xp nECrAh2s");
- print 'hi';
- # -t hacevedo3\@gmail.com -f $FORM{email} -u 'Subject: Feedback from $FORM{name} at $ENV{'REMOTE_HOST'}' -m 'The user wrote: $FORM{feedback}' -s smtp.gmail.com -o tls=yes -xu tempsendemail\@gmail.com -xp nECrAh2s
- print <<START;
- <html><head>
- <title>Guest book Result</title>
- <body>
- <h1 align="center">Guest book Results</h1>
- Dear $FORM{'name'},<BR>We would like to thank You for taking some time to fillout our Guest Book.
- We appreciate your input and have a great day!<br><br>
- <table>
- <tr><td>Name</td><td>$FORM{'name'}</td></tr>
- <tr><td>E Mail</td><td>
- <a href="mailto:$FORM{'email'}">$FORM{'email'}</a></td></tr>
- <tr><td>Comments</td><td>$FORM{'feedback'}</td></tr>
- </table>
- <input type=\"button\" value=\"View Guestbook\" onclick=\"location.href='../frame.html'\">
- </body>
- </html>
- START
- # Open Guest Book File
- open (FILE, ">>../../www/guests.html") or die "Can't open guests.txt: $!\n";
- #Write the information to the file
- print FILE "<hr/>";
- print FILE "$FORM{'name'} came from $FORM{'loc'}.";
- print FILE "E-mail address is $FORM{'email'}.";
- print FILE "Comments : $FORM{'feedback'}\n";
- close(FILE);
Add Comment
Please, Sign In to add comment