I'm not being funny but seeing as i just registered for this site, i thought you lot would take it easy with me.

Anyway, in the tutorial I looked at, the idea was to have a file for each user and the password in that file. I simpflied it a bit and ignored the need for encryption and cookies.

The link to the tutorial is here. The script executes without errors but doesn't recognise the user from the form on the previous page. Here's a snippet of the code:

... use constant USER_DATA => '../data/users/'; my $username = param( 'login' ) || ''; my $password = param( 'password' ) || ''; my $userfile = USER_DATA.$username; my $message = 'Bad password'; open USER, "< $userfile" or display_page( "Your username and password +information did not match. Check to see that you do not have Caps Lock on, hit the back button, and try again." ), exit; my $real_password = <USER>; close USER; if ( $password eq $real_password ) { $message = "Hello, $username. You gave me a good password"; } ...

Thanks, onemadjock


In reply to Re: Re: perl tutorial clarification by onemadjock
in thread perl tutorial clarification by onemadjock

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.