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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.