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);
In reply to changing password by bory
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |