Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I'm misunderstood here .. what I meant is why bothering with files to check passwords and users when you have the possibility to use somewhat powerfull security meshanism of MySQL DBMS. There are tabels like user, db, host, etc ... which brings ease to administration of privileges. The problem was to solve how to read and check and write passwords so that there would be no problem. One solution is locking, but why bother when the problem is completely solved in MySQL?! If I did it, and there are many users with different passwords, anyone can do it!
use DBI; use CGI qw(param); my $username = param("password"); my $password = param("username"); 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;
so, as you can see it will display the error message if the script could not connect to database using provided password and username .. its that easy .. no need to break your head with locking problem, which is absolutly unecesary here! of course, you have to have two fields called "password" and "username" in you form and submit them to Perl script My reputation is -18 for this answer .. what does that mean?

In reply to Re: File locking by Alex the Serb
in thread File locking by nysus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (8)
As of 2024-04-16 09:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found