in reply to Re^6: Parse form data to database
in thread Parse form data to database
-- 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:
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.# 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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Parse form data to database
by tryharder (Initiate) on May 13, 2006 at 17:03 UTC |