Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

login and passwd

by qurrat79
on Jun 01, 2003 at 04:11 UTC ( #262166=perlquestion: print w/ replies, xml ) Need Help??
qurrat79 has asked for the wisdom of the Perl Monks concerning the following question:

1. Need to send the userid and password from the form to the "monthly record table" in database and verify id and password. 2.After verification of the userid & password, the monthly record should be retrieved and displayed as a webpage.

Comment on login and passwd
Re: login and passwd
by Coruscate (Sexton) on Jun 01, 2003 at 04:34 UTC

    #!/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.

      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

        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.



        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.
Re: login and passwd
by sauoq (Abbot) on Jun 01, 2003 at 05:29 UTC

    Sounds to me like you need to hire a Perl Programmer... Try adding a job listing at http://jobs.perl.org/.

    -sauoq
    "My two cents aren't worth a dime.";
    
Re: login and passwd
by George_Sherston (Vicar) on Jun 01, 2003 at 14:42 UTC
    Don't be discouraged! People round here are staggeringly helpful and knowledgeable, but (A) are more forthcoming with their perls of wisdom if asked in a way that shows some effort and (B) don't always use SOPW::Psychic, so may not be able to know what you need to know unless you spell it out a bit. If you glance over this thread and then ask your question again in a re-formulated manner I'd bet you dollars to empty donut cartons you find out what you need. Enjoy!

    George Sherston

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://262166]
Approved by krisahoch
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2014-07-31 06:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (245 votes), past polls