Guest User

Untitled

a guest
Dec 18th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. if ('POST' eq request_method && param('username') && param('password')){
  2. my $dbh = DBI->connect( "DBI:mysql:database_name","database_name", "<censored>", {'RaiseError' => 1});
  3. my $query="Select * FROM users where username =".$dbh->quote(param('username')) . " and password =".$dbh->quote(param('password'));
  4.  
  5. my $sth = $dbh->prepare($query);
  6. $sth->execute();
  7. my $ver = $sth->fetch();
  8. if ($ver){
  9. print "win!<br>";
  10. print "here is your result:<br>";
  11. print @$ver;
  12. }
  13. else{
  14. print "fail";
  15. }
  16. $sth->finish();
  17. $dbh->disconnect();
  18. }
Add Comment
Please, Sign In to add comment