#!/usr/bin/perl -w use strict; use MDBI; use CGI ':standard'; MConnect 'table_name', 'user', 'pwd'; if (not defined param('id') || not defined param('pwd')) { print header(), start_html('Please login'), p('Pass authentication to the script!'), end_html(); } else { my $data = MSelect {}, '* FROM monthly_record WHERE userid=? AND userpwd=?', param('id'), param('pwd'); if (not defined $data) { print header(), start_html('Invalid Login'), p('Invalid User Login. Try again.'), end_html(); } else { print header(), start_html('Monthly Record'), p('Your monthly record report:'), p($data->[0]->{'report'}), end_html(); } }