Guest User

Untitled

a guest
Dec 26th, 2017
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. #!../perl/bin/perl.exe -Tw
  2.  
  3. my $query_string = '';
  4. #Get the input
  5. if ($ENV{REQUEST_METHOD} eq 'POST') {
  6. read(STDIN, $query_string, $ENV{CONTENT_LENGTH});
  7. } else {
  8. $query_string = $ENV{QUERY_STRING};
  9. }
  10.  
  11. # Split the name-value pairs
  12. @pairs = split(/&/, $query_string);
  13.  
  14. foreach $pair (@pairs) {
  15. ($name, $value) = split(/=/, $pair);
  16.  
  17. # Making the input English. And removing unwanted things
  18. $value =~ tr/+/ /;
  19. $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  20.  
  21. $FORM{$name} = $value;
  22. }
  23.  
  24. # Give output
  25. print "Content-type: text/html\n\n";
  26. open(ECHO, '| echo 1') or print 'hi';
  27. #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");
  28.  
  29. print 'hi';
  30.  
  31. # -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
  32.  
  33. print <<START;
  34. <html><head>
  35. <title>Guest book Result</title>
  36. <body>
  37. <h1 align="center">Guest book Results</h1>
  38.  
  39. Dear $FORM{'name'},<BR>We would like to thank You for taking some time to fillout our Guest Book.
  40. We appreciate your input and have a great day!<br><br>
  41. <table>
  42. <tr><td>Name</td><td>$FORM{'name'}</td></tr>
  43. <tr><td>E Mail</td><td>
  44. <a href="mailto:$FORM{'email'}">$FORM{'email'}</a></td></tr>
  45. <tr><td>Comments</td><td>$FORM{'feedback'}</td></tr>
  46. </table>
  47. <input type=\"button\" value=\"View Guestbook\" onclick=\"location.href='../frame.html'\">
  48. </body>
  49. </html>
  50. START
  51.  
  52. # Open Guest Book File
  53. open (FILE, ">>../../www/guests.html") or die "Can't open guests.txt: $!\n";
  54. #Write the information to the file
  55. print FILE "<hr/>";
  56. print FILE "$FORM{'name'} came from $FORM{'loc'}.";
  57. print FILE "E-mail address is $FORM{'email'}.";
  58. print FILE "Comments : $FORM{'feedback'}\n";
  59. close(FILE);
Add Comment
Please, Sign In to add comment