source: text-formbuilder/trunk/bin/fb-cgi.pl @ 3

Last change on this file since 3 was 1, checked in by peter, 20 years ago

initial import

File size: 752 bytes
Line 
1use strict;
2use warnings;
3
4use Text::FormBuilder;
5use CGI;
6
7my $q = CGI->new;
8
9my $src_file = get_src_file($q->param('form_id'));
10
11my $parser = Text::FormBuilder->new;
12my $form = $parser->parse($src_file)->build(method => 'POST', params => $q)->form;
13
14if ($form->submitted && $form->validate) {
15    # TODO:
16    # call storage function
17    my $plugin = 'DumpParams';
18    eval "use $plugin;";
19   
20    if ($plugin->process($q)) {
21        # show thank you page
22        #print $q->header('text/plain');
23        #print "Thank you for your input!\n"
24    } else {
25        # there was an error processing the results
26    }
27   
28} else {
29    print $q->header;
30    print $form->render;
31}
32
33sub get_src_file {
34    my $form_id = shift;
35    return "$form_id.txt";
36}
Note: See TracBrowser for help on using the repository browser.