Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ('POST' eq request_method && param('username') && param('password')){
- my $dbh = DBI->connect( "DBI:mysql:database_name","database_name", "<censored>", {'RaiseError' => 1});
- my $query="Select * FROM users where username =".$dbh->quote(param('username')) . " and password =".$dbh->quote(param('password'));
- my $sth = $dbh->prepare($query);
- $sth->execute();
- my $ver = $sth->fetch();
- if ($ver){
- print "win!<br>";
- print "here is your result:<br>";
- print @$ver;
- }
- else{
- print "fail";
- }
- $sth->finish();
- $dbh->disconnect();
- }
Add Comment
Please, Sign In to add comment