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

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.