Hi,
I'm confused as to how I can show or a success message based on whether or not the username was deleted from the data file. Here is a snippet of the code. I just threw the success sub in there as I didn't know how to insert it.
Any pointers would be appreciated.
open(PWD,">$members_file") | | &error('Server Error. Chmod all writable files to 666.');
foreach $user (@users) {
chomp $user;
@all = split(/:/, $user);
if ($all[0] ne $formdata{'username'}) {
print PWD "$user\n";
close(PWD);
last;
&success('The account you entered was deleted.');
#if $all[0] eq $formdata{'username'};
# &error('The username you entered is not in the database. Try again.');
} else {
&error('The username you entered is not in the database. Try again.');
}
}
Thanks,
Tim
I'm confused as to how I can show or a success message based on whether or not the username was deleted from the data file. Here is a snippet of the code. I just threw the success sub in there as I didn't know how to insert it.
Any pointers would be appreciated.
open(PWD,">$members_file") | | &error('Server Error. Chmod all writable files to 666.');
foreach $user (@users) {
chomp $user;
@all = split(/:/, $user);
if ($all[0] ne $formdata{'username'}) {
print PWD "$user\n";
close(PWD);
last;
&success('The account you entered was deleted.');
#if $all[0] eq $formdata{'username'};
# &error('The username you entered is not in the database. Try again.');
} else {
&error('The username you entered is not in the database. Try again.');
}
}
Thanks,
Tim