Two Form Actions?

software development

#1

I have an either/or dilemmna that would be solved if a form can have two actions.

I have a form that sends a quite a bit of information to an editor. Works fine. Simple. Submitter washes their hands of the data.

I have a flattext.com script (great resource by the way) that writes an equivalent form to a web file, AND allows the submitter or editor to search and edit records online. writes to the file.

But…but…it would be a treat if the form could both write to the file and send the same data with the one submit button. Can I add a second action to my form? Even better if it would send after successfully writing the record, but that may exceed my cut-n-paste skills :slight_smile:


#2

You would have use some coding skillz and mofiy the flattext.com script to e-mail the data, too. If its written in Perl, thats a piece of cake -

[code]my $sendmail = ‘|/usr/sbin/sendmail -t’;
my $message = <<TEXT;
To: $sender
From: $recipient
Subject: $subject

This is an e-mail message, blah blah
blah blah blah.
TEXT
$message =~ s/\n/\r\n/g;
if (open(MAIL, $sendmail)) {
print MAIL $message;
close(MAIL);
print “Message sent.”;
}
else {
print “Could not open pipe to sendmail.”
}
[/code]


#3

Thanks. That probably exeeds my capability but I might get brave and try some ‘trial and error’ editing of that snippet to see if can drop it in somewhere and make it work. As long as I keep my backup, what could it hurt to try? My first wonderment is where/how $recipient is defined. I bet I can find an example already in the script for some other field definition.