Your original question has been answered, but I'd just like to point out a better way of printing out text to the user. You have the following snippet of code:
print "<FORM METHOD=\"post\" ACTION=\"http://hostname/~user/cgi-bin/da +tabase/homepage.cgi\">"; print "<TABLE><TR VALIGN=\"baseline\"><TD VALIGN=\"baseline\"><h3>Ente +r user name</h3></TD><TD><INPU +T TYPE=\"TEXT\" NAME=\"username\" SIZE=\"10\"></TD></TR><TR VALIGN=\" +baseline\"><TD VALIGN=\"baseli +ne\"><h3>Enter password</h3></TD> <TD><INPUT TYPE=\"password\" NAME=\ +"password\" SIZE=\"10\"></TD>< +/TR><TD><INPUT TYPE=\"SUBMIT\" value=\"Log in\"></TABLE></FORM>";
That hurts the eyes a lot and is difficult to read and would be a nightmare to maintain. You might want to look up on how to use qq() to print out text to the user in a way in which you wouldn't have to backslash all the double quotes. Also, I'm sorry to say it, but the html itself is horrendous. You use H3 tags within a table cell just to enlarge the text a bit. There is in existance a th tag that will boldface the text within a cell for you. Sorry if I make this sound harsh, but I think you need to spend some major time learning html a little better. BTW, the valign='baseline' attributes won't do much for you. Uch. Myself, I would rewrite that like this:
print start_form({ method => 'post', action => 'http://hostname/.../homepage.cgi' }), table(), Tr( th( {align=>'left'}, 'Enter Username:' ), td( textfield('username') ) ), Tr( th( {align=>'left'}, 'Enter Password:' ), td( password_field('password') ) ), Tr( th( {colspan=>2}, submit('Login') ) ) ), end_form();
Update: Cool! I got node_id 237000. Nice round number :)
If the above content is missing any vital points or you feel that any of the information is misleading, incorrect or irrelevant, please feel free to downvote the post. At the same time, reply to this node or /msg me to tell me what is wrong with the post, so that I may update the node to the best of my ability. If you do not inform me as to why the post deserved a downvote, your vote does not have any significance and will be disregarded.
In reply to Re: CGI + password problems
by Coruscate
in thread CGI + password problems
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |