bory has asked for the wisdom of the Perl Monks concerning the following question:
Thank you very much for your time!#!/agl/tools/perl/bin/perl use strict; use CGI ':standard'; my $I_username = param('username'); my $I_psswd = param('password'); my $I_newpsswd = param('new_password'); my $I_cnewpsswd = param('cnew_password'); my $data_file = '/data/aww/cgi-bin/login.txt'; open(DAT, "+>>$data_file") || die("Could not open file: $!"); my %password; while (<DAT>) { chomp; my ($k, $v) = split /\=/; $password{$k} = $v; if (($I_username eq $k) and ($password{$I_username} eq $I_ps +swd) and ($I_newpsswd eq $I_cnewpsswd)){ print DAT "$I_username=$I_newpsswd \n"; print "<h2>OK</h2>"; } else { if($I_newpsswd ne $I_cnewpsswd){print " +<center><h2>Noua parola nu se potriveste !</h2></center>\n";} else {if($I_username ne $k){ print "<center><h2>Utilizatorul + nu exista!</h2></center>\n";} else {if($password{$I_username} ne $I_psswd){ print "<center +><h2>Ai introdus parola veche gresit!</h2></center>";} } }}} close(DAT);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: changing password
by TVSET (Chaplain) on Sep 25, 2003 at 08:44 UTC | |
by Zaxo (Archbishop) on Sep 25, 2003 at 16:13 UTC | |
by bory (Beadle) on Sep 25, 2003 at 09:02 UTC | |
by Abigail-II (Bishop) on Sep 25, 2003 at 09:19 UTC | |
by bory (Beadle) on Sep 25, 2003 at 09:37 UTC | |
|
Re: changing password
by sulfericacid (Deacon) on Sep 25, 2003 at 17:56 UTC |