wil has asked for the wisdom of the Perl Monks concerning the following question:
###################################################################### +################# sub register_form { # -------------------------------------------------------------------- +------ # Output registration form. # my $self = shift; my $errs = shift; my $q = $self->query(); $self->set_session($q->cookie('SID')); my $lang_bit = $self->{session}{lang} || $q->param('lang'); my $tmpl_path = "dynamic/" . $lang_bit . "_" . "register.shtml"; my $tmpl = $self->load_tmpl($tmpl_path, die_on_bad_params => 0); $tmpl->param($errs) if $errs; return $tmpl->output; } ###################################################################### +################# sub register_process { # -------------------------------------------------------------------- +------ # Process registration form using CGI::Application::ValidateRM to c +heck # for blank required fields.. # my $self = shift; my $q = $self->query(); my ($results, $err_page) = $self->check_rm('register_form','_form +_register_profile'); return $err_page if $err_page; #.. do something with DFV $results object now my $lang_bit = $self->{session}{lang} || $q->param('lang'); my $tmpl_path = "dynamic/" . $lang_bit . "_" . "register_success.s +html"; my $tmpl = $self->load_tmpl($tmpl_path, die_on_bad_params => 0); return $tmpl->output; } ###################################################################### +################# sub _form_register_profile { # -------------------------------------------------------------------- +------ # Internal sub called from register_process to determine required # form variables for registration form. # return { required => 'email', }; } ###################################################################### +#################
- wil[Wed May 14 19:10:33 2003] [error] Error executing run mode 'register_ +process'. Eval of code '$self->register_process' resulted in error: +Can't use an undefined value as a HASH reference at /usr/local/lib/pe +rl5/site_perl/5.6.1/Data/FormValidator/Results.pm line 570.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: CGI Application and Forms
by markjugg (Curate) on May 15, 2003 at 16:06 UTC |