Hello,

I have the first version of my module ready for release.

I named it ExpireForm, people at comp.lang.perl.modules suggested: CGI::Form::Expire and CGI::Form::Unique, From these 2, I think CGI::Form::Expire describes better the module funcionality.

This is an extract of the README file:

#####
ExpireForm is a Perl Module to make forms expire after they have
been successfully submitted, it relies on a simple hidden field on the
html form, It's not CGI.pm dependant so you can use it with whatever
framework you preffer, I do use CGI.pm though.

ExpireForm provides the same interface no matter what backend you use
to store the Form Expiration Data, drivers currently provided include:
CSV, MySQL and PostgreSQL. A driver for Colon Separated Values (ColonSV)
is provided as an example of a non DBI driver (and itīs used to run the
tests) but I advice you to use CSV instead of ColonSV for production
systems.

A simple example of how to use ExpireForm with CGI.pm could be:

use ExpireForm;
# Create the ExpireForm object and select the appropiate driver
my $ef = ExpireForm->new(driver=>'CSV', options=>\@options);

# On the form building part of you script
print start_form(),
textfield('name'),
$ef->form_expirer, # this creates the hidden field
submit(),
end_form();

# then do the check on the form processing part of your scripts
my $fid = param('FID'); # Get the FID value
if ($ef->form_found($fid) && $ef->form_not_submitted($fid)) {
# If the form exists but it has not been submitted yet,
# do some processing to the form
...
# then mark it as submitted
$ef->mark_as_sent($fid);
} else {
print p('this form has already expired!');
}
#####

Best Regards,

Juan Jose Natera

Reply via email to