Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl -wt
- #location of perl
- use CGI;
- use CGI::Cookie;
- #grabs data that was passed from the form.
- my $q = new CGI;
- my $usernamei = $q->param( "usernamei" );
- my $thep = $q->param( "thep" );
- my $cuser = 'matt';
- my $cpass = 'reddit';
- my $file = 'b.txt';
- if (($usernamei eq $cuser) && ($thep eq $cpass)) {
- my $newcook = new CGI::Cookie(-name => 'somename',
- -value => 'reddit',
- -expires => '+60m',
- -domain => 'fubar.com');
- $q->header(-cookie=>$newcook);
- print " <h1>Welcome $cuser</h1>\n";
- open(books, "$file")|| die("Could not open b.txt");
- $bookarray=<books>;
- close(books);
- print " <h1>$bookarray</h1>\n";
- print " <h1>next</h1>\n";
- @splitaray = split(/\|/, $bookarray, LIMIT);
- print " <h1>@splitarray</h1>\n";
- print " <table width="250" border="2">\n";
- print " <tr>\n";
- print " <td>\n";
- print " <table width="250" border="2">\n";
- foreach $splitarray(@splitarray[0,2,4,6])
- print "<tr><td>$sitename</td></tr>\n\n";
- print " </table>\n";
- print " </td>\n";
- print " <td>\n";
- #######################
- print " </td>\n";
- print " </tr>\n";
- print "</table>\n";
- }else
- {
- $q->header(-type => "text/plain");
- print <<LLL;
- Login Failure!
- LLL
- }
- Mibbit.com Pasted on 2010-10-27 03:56:17
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement