Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.26 KB | None | 0 0
  1. #!/usr/bin/perl -wt
  2. #location of perl
  3.  
  4.  
  5. use CGI;
  6. use CGI::Cookie;
  7.  
  8.  
  9. #grabs data that was passed from the form.
  10. my $q = new CGI;
  11. my $usernamei = $q->param( "usernamei" );
  12. my $thep = $q->param( "thep" );
  13. my $cuser = 'matt';
  14. my $cpass = 'reddit';
  15. my $file = 'b.txt';
  16.  
  17.  
  18.  
  19. if (($usernamei eq $cuser) && ($thep eq $cpass)) {
  20.  
  21.  
  22. my $newcook = new CGI::Cookie(-name => 'somename',
  23. -value => 'reddit',
  24. -expires => '+60m',
  25. -domain => 'fubar.com');
  26.  
  27. $q->header(-cookie=>$newcook);
  28.  
  29. print " <h1>Welcome $cuser</h1>\n";
  30.  
  31. open(books, "$file")|| die("Could not open b.txt");
  32. $bookarray=<books>;
  33. close(books);
  34. print " <h1>$bookarray</h1>\n";
  35.  
  36.  
  37. print " <h1>next</h1>\n";
  38. @splitaray = split(/\|/, $bookarray, LIMIT);
  39. print " <h1>@splitarray</h1>\n";
  40.  
  41.  
  42.  
  43. print " <table width="250" border="2">\n";
  44. print " <tr>\n";
  45. print " <td>\n";
  46.  
  47.  
  48.  
  49. print " <table width="250" border="2">\n";
  50.  
  51.  
  52. foreach $splitarray(@splitarray[0,2,4,6])
  53. print "<tr><td>$sitename</td></tr>\n\n";
  54.  
  55.  
  56.  
  57. print " </table>\n";
  58.  
  59.  
  60.  
  61. print " </td>\n";
  62. print " <td>\n";
  63.  
  64.  
  65. #######################
  66.  
  67.  
  68.  
  69. print " </td>\n";
  70. print " </tr>\n";
  71. print "</table>\n";
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78. }else
  79. {
  80. $q->header(-type => "text/plain");
  81. print <<LLL;
  82. Login Failure!
  83. LLL
  84. }
  85. Mibbit.com Pasted on 2010-10-27 03:56:17
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement