Hi Lois,
I think I know what ya meant and I tried adding that in the file upload part of it, but it still went in for validation when I just modified the text.
I tried putting it in different places, then got to thinking that maybe there needs to be something else added like an elsif $new_files = 0 or something, but not sure where I'd add that. Here's how it stands right now (note: This is the setup for the sql version, but it should work for both which is why I'm posting in here)
($auth_user_field >= 0) and ($in{$auth_user_field} = $db_userid);
# Check to make sure the record passes the reg exp and null checks.
foreach $key (keys %in) {
if ($in{$key} eq 'delete') {
unlink "$SAVE_DIRECTORY/$in{$db_key}/$key";
}
}
$num_files=0;
if (-e "$SAVE_DIRECTORY/$in{$db_key}") {
opendir (GRAPHIC, "$SAVE_DIRECTORY/$in{$db_key}") or &cgierr("unable to open directory: $SAVE_DIRECTORY/$rec{$db_key}. Reason: $!");
@files = readdir(GRAPHIC);
closedir (GRAPHIC);
foreach $file (@files) {
next if ($file =~ /^\./); # Skip "." and ".." entries..
next if ($file =~ /^index/); # Skip index.htm type files..
++$num_files;
}
}
if ($num_files or $in{'file-to-upload-1'}) { $in{'Graphic'} = 'Yes'; }
else { $in{'Graphic'} = ''; }
(!$per_admin) and ($in{$db_validated_field} = "No");
$status = &validate_record; # Check to make sure the modifications are ok!
if (($status eq "ok") && ($in{'file-to-upload-1'})) { $status = &validate_upload; } #Validate Pictures
if ($status eq "ok") {
Thanks again!
DBMan SQL Version 1 mods available at:
http://dbmansqlmods.rainbowroomies.com (Mods based on JPDeni's original mods.)