sulfericacid has asked for the wisdom of the Perl Monks concerning the following question:
This collects information from a url like:
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.http://sulfericacid.perlmonk.org/evs/evs.pl?accountID=nKc5oWPOnaPeTHCz +f&accountAD=sulfericacid@earthlink.net .
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; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parameter testing
by tadman (Prior) on Jul 21, 2003 at 21:33 UTC | |
by sulfericacid (Deacon) on Jul 21, 2003 at 21:37 UTC | |
|
Re: Parameter testing
by jsprat (Curate) on Jul 21, 2003 at 21:24 UTC | |
by sulfericacid (Deacon) on Jul 21, 2003 at 21:31 UTC | |
by michellem (Friar) on Jul 21, 2003 at 21:33 UTC |