i can't figure out how to implement these into my script...here are example from each submit sub: this is to submit each name\e-mail to the database, there is another script that checks the valid e-mail from the database and sends if it is found in the db
# sub - submit
sub submit {
### staff
if ($FORM{'form'} eq "staff"

{
# validate
if ($FORM{'position'} eq ""

{&error("Postion field was left blank. Please hit back and complete the form."

;}
if ($FORM{'name'} eq ""

{&error("Name field was left blank. Please hit back and complete the form."

;}
# open staff.txt for editing
open (STAFF,">>$filedir/staff.txt"

|| &error("Can't Open staff.txt $!\n"

;
# staff printing
print STAFF "$FORM{'name'}~|~$FORM{'position'}~|~$FORM{'mail'}~|~\n";
close(STAFF);
}
# editsubmit sub
sub editsubmit {
if ($FORM{'form'} eq "staff"

{
@varkeys = keys (%FORM);
foreach $line(@varkeys) {
unless ($line eq "action" || $line eq "form" || $line eq "$tempnum|del"

{
($tempnum, $varname) = split(/\|/, $line);
if ($varname eq "name"

{
$del = "$tempnum"."|"."del";
$name = "$tempnum"."|"."name";
$position = "$tempnum"."|"."position";
$mail = "$tempnum"."|"."mail";
unless ($FORM{"$del"} eq "yes"

{
$list[$tempnum] = "$FORM{$name}~|~$FORM{$position}~|~$FORM{$mail}~|~\n";
}
}
}
}
open (STAFF,">$filedir/staff.txt"

|| &error("Can't Open staff.txt $!\n"

;
print STAFF "@list";
close(STAFF);
}