$accountID and $accountAD are both url_params (all the foreaches are just db test prints).

This collects information from a url like:

http://sulfericacid.perlmonk.org/evs/evs.pl?accountID=nKc5oWPOnaPeTHCz +f&accountAD=sulfericacid@earthlink.net .
The snippet below is supposed to check both AD and ID against the database to be sure that the ID exists and that its value = AD.

If you switch the characters in accountID around it gives off "Email address not found" when I expected a different error.

If you switch the accountAD around but leave the original accountID the same, it'll add whatever email address you gave it to the db and say it was fine.

Can someone tell me what's wrong with this checking? I need it to be sure that ID exists and that it equals AD or it should exit. Any suggestions would be much appreciated.

if ( $accountID && ( $accountAD ne '' ) ) { if ( exists $unv{$accountID} ) { print "\$accountID found: $unv{$accountID}<br>"; if ( $unv{$accountID} = $accountAD ) { $dbm{$accountAD} = $accountAD; delete $unv{$ID}; print "Your address has been indexed successfully!<br> +"; print qq(Please click <a href="$url">here</a> to submi +t another address); exit; } else { print "Registration didn't match.<br>"; print qq(Please click <a href="$url">here</a> to resen +d information); foreach (keys %unv) { print "$_ => $unv{$_}<br>"; exit; } } } else { print "Email address not found. Please re-submit your + details.<br>"; print qq(Please click <a href="$url">here</a> to try a +gain); exit; } } }


"Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

sulfericacid

In reply to Parameter testing by sulfericacid

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.