-my $formname = $opt{'formname'};
-my $key = $formname.'bill'.$custnum;
-my $url = $opt{'url'} || '';
-my $message = $opt{'message'} || 'Finished!';
+# formname no longer needs to be passed from outside, but we still
+# need one and it needs to be unique
+my $formname = $opt{'formname'} ||
+ 'bill'.sprintf('%04d',random_id(4)).$custnum;