#THE LOGIN PAGE *********************** #!/biol/programs/perl/bin/perl -w use strict; use DBI; use CGI qw(:standard); my $cgi = new CGI; use CGI::Carp qw(fatalsToBrowser); print "Content-type:text/html\n\n"; print <database

Enter user name

Enter password

EOF #### #!/biol/programs/perl/bin/perl -w use strict; use DBI; use CGI qw(:standard); my $cgi = new CGI; my $username = $cgi->param('username_box'); my $password = $cgi->param('password_box'); my ($sth, $sth2); my $dbh = DBI->connect("DBI:mysql:host=myhost;database=my_db", "$use +rname","$password", {PrintError =>0, RaiseError => 1}) || die "Databa +se connection not made"; my $plate = $cgi->param("plate"); print $cgi->start_form (-method => "POST"); print $cgi->textfield (-name => "plate", -value => $plate,-size => 40); print $cgi->submit (-name => "button", -value=>"search"); print $cgi->end_form (); print "Search results for keyword: $plate \n", $cgi->escapeHTML; $sth2 = $dbh->prepare (qq{ SELECT * FROM plate WHERE plate_id LIKE +? }); $sth2->execute("%" . $plate . "%" ); my $sql = qq{select * from plate}; $sth = $dbh->prepare ($sql); $sth->execute(); while (my $row = $sth->fetchrow_arrayref) { print join ("\t", @$row), "

"; } $dbh->disconnect(); print $cgi->end_html ();