or download this
use DBI;
use CGI qw(param);
...
my $dbh = DBI->connect("DBI:mysql:database=$mydatabase",$username,$pas
+sword);
print "<HTML><BODY>Woo this is wrong, you typed for user: $username pa
+ssword: $password and it seams that there is no such thing!</BODY></H
+TML>" if !$dbh;