in reply to login and passwd

#!/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(); } }

That snippet of code probably made as much sense to you as your questions did to me ;)


If the above content is missing any vital points or you feel that any of the information is misleading, incorrect or irrelevant, please feel free to downvote the post. At the same time, please reply to this node or /msg me to inform me as to what is wrong with the post, so that I may update the node to the best of my ability.

Replies are listed 'Best First'.
Re: Re: login and passwd
by Cody Pendant (Prior) on Jun 02, 2003 at 00:43 UTC
    It might not have been much use to the OP, but it looks very neat to me -- I'm off in search of MDBI at CPAN. Never heard of it.
    --
    “Every bit of code is either naturally related to the problem at hand, or else it's an accidental side effect of the fact that you happened to solve the problem using a digital computer.”
    M-J D


      same here...
      Could you also use the same to insert, update delete etc. from an rdbms database?

      we're born with our eyes closed and our mouths wide open, and we spend our entire life trying to rectify that mistake of nature. - anonymous.

      MDBI is my own little DBI module. I find it very handy for everything I use. ;)


      If the above content is missing any vital points or you feel that any of the information is misleading, incorrect or irrelevant, please feel free to downvote the post. At the same time, please reply to this node or /msg me to inform me as to what is wrong with the post, so that I may update the node to the best of my ability.