Regarding this code you just posted:

-- When you open a file for append access ( ">>file.name"), you don't need to seek to the end of the file -- you are already there. (Likewise, after you remove the "\r", you don't need to remove "\cM" -- that's a synonym for "\r".)

-- Why do you have those  <br> tags after the print statements to the output file? Are those really in your script, or is that just an artifact of learning how to post code here at PerlMonks? If those tags are really in the code, each one is a syntax error. Get rid of them.

-- Apropos of syntax errors, I hope that you have perl available on a local machine, so you can at least try  perl -cw your_script on the command line. This will tell you whether the code compiles, which you need to know before putting it on a server where you can't see the error logs.

-- Is it the case that nothing ever gets written to the output file at all? Do you get the "Error" message from your "dienice" call showing up as the result? What does that say? (Permission denied? something else? This is the second time I'm asking this question...)

As for giving you some sense of direction, I was hoping my earlier reply already did that. Writing the code for you would be wrong, but assuming that this particular script you posted is specifically for adding a new user to the database, I think a pseudo-code overview should be something like this:

# pring http header # decode params # if required params are not present # print explanation with link to sign-up page # exit # open database file for r/w access # get lock on that file # read current contents # if userid from form exists in database # close file # print explanation with link to sign-up page # exit # print new entry fields to database file # close file # print confirmation message
You need to make sure you add tests for error conditions with suitable calls to dienice as needed. As for the other components of the overall setup (login, password reminder), I'm hoping you can work those out in adequate detail on your own now. Good luck.

In reply to Re^7: Parse form data to database by graff
in thread Parse form data to database by tryharder

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.