I hope this is helpful. This is the "email me my password" code:
[% my $str; $str.="Forgot your username or password? All we need is one of the f +ollowing blanks filled in correctly and you should be able to find th +e answers to your most perplexing question"; $str.=$query->start_form("POST", $ENV{SCRIPT_NAME}); $str.='<INPUT TYPE="hidden" NAME="op" VALUE="lostpasswd">'; $str.=$query->hidden('node_id',getId($NODE)); $str.="Your username:"; $str.='<INPUT TYPE="text" NAME="username" VALUE=""><br>'; $str.="Your e-mail address:"; $str.='<INPUT TYPE="text" NAME="email" VALUE=""><br>'; $str.=$query->submit("sexisgood", "Mail me my password, Cowboy!"); $str.=$query->end_form; if($query->param('op') eq 'lostpasswd' and ($query->param('username' +) || $query->param('email'))){ my $haverow=0; my $username=$query->param('username'); my $email=$query->param('email'); my @N; if($username){ @N = getNode($username, getType('user')); $haverow=$N[0]; } if(!$haverow and $email){ @N=$DB->getNodeWhere ({email => $email}, $DB->getType('user' +)); $haverow=$N[0]; } if($haverow){ my ($n) = getNode('Password Mail', getType('mail')); $$n{doctext} =~ s/\<name\>/$$haverow{realname}/; $$n{doctext} =~ s/\<user\>/$$haverow{title}/; $$n{doctext} =~ s/\<passwd\>/$$haverow{passwd}/; $$n{doctext} =~ s/\<site_name\>/$HTMLVARS{site_name}/; $$n{doctext} =~ s/\<site_url\>/$HTMLVARS{site_url}/; use Everything::MAIL; my $addr = node2mail($$haverow{email},$n); $n = getNodeById(getId($n), 'force'); $str.="<BR><H3>Your password and username should be on its wa +y</H3>"; $str.= "Addr7: " . $addr; print "<BR>$addr"; } else{ $str="<B>Couldn't find any info that matched what you gave us +, make sure you typed in everything correctly!</B><BR><BR>".$str; } } $str; %]

To see what is going on, gohere.

Enter apessos as the username and any email address. The code is very similar to what I have already posted. The node2mail is a package stored at /usr/local/lib/perl5/site_perl/5.6.1/Everything.

If there is any other piece of information that would be helpful, let me know.


In reply to Re: Re: HASH question by apessos
in thread HASH question by apessos

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.