barrycarlyon has asked for the wisdom of the Perl Monks concerning the following question:
Ok, bit of a problem
Using cgi, and the following code:
Using readmore coz theres a lot
use CGI; use Class::Date; #Own Modules - to see if the user exists? use SuperClan::Database::Users; sub setup { my $self = shift; $self->start_mode('email'); $self->run_modes([qw/email email_member/]); } sub email { my $self = shift; my $html_template = $self->param('html_template'); my $cgi = CGI->new; my $session = $cgi->param('session'); my $user_status; my $return; my $output; if ( $session eq "" ) { $self->header_props( -url => "/" ); $self->header_type('redirect'); } else { #session exists run std session app $return = SuperClan::Application::SuperClan::session($session); ($user_status, $session) = split /b/, $return; if (($user_status eq "logged_out")||($user_status eq "hacking_attemp +t")) { $html_template->process('user', { wrapper => $self->wrapper(), session => $session, user_status => $user_status, }, \$output) || die $html_template->error; } else { $html_template->process('email', { wrapper => $self->wrapper(), session => $session, user_status => $user_status, process => "email", }, \$output) || die $html_template->error; } return $output; } } sub email_member { my $self = shift; my $errs = shift; my $html_template = $self->param('html_template'); my $cgi = CGI->new; my $session = $cgi->param('session'); my $member = $cgi->param('member'); my $user_status; my $return; my $output; my @members; if ( $session eq "" ) { $self->header_props( -url => "/?session=".$session ); $self->header_type('redirect'); } else { #session exists run std session app $return = SuperClan::Application::SuperClan::session($session); ($user_status, $session) = split /b/, $return; if (($user_status eq "logged_out")||($user_status eq "hacking_attemp +t")) { $html_template->process('user', { wrapper => $self->wrapper(), session => $session, user_status => $user_status, }, \$output) || die $html_template->error; } else { @members = SuperClan::Database::Users->retrieve_all; $html_template->process('email', { wrapper => $self->wrapper(), session => $session, user_status => $user_status, process => "email_member", members => \@members, member => $member, errors => $errs, }, \$output) || die $html_template->error; } return $output; } }/ 1;
And using the apporpriate rewrite engine and rules in the htaccess file, why can I not send the ?session=x in the address line to the fucntions which are not the start mode
To be specific the start mode (email) can capture the session using $session=$cgi->param('session'); but the other function (email_member), can not capture the session from the address line, when using /email_member/?session, unless i use ?rm=email_member&session=x.
.htaccess
YoursRewriteEngine on RewriteRule email_member/$ ?rm=email_member SetHandler perl-script PerlHandler SuperClan::Application::Email->handler
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI, and fetching things from the 'address line'
by Corion (Patriarch) on Jun 23, 2006 at 12:57 UTC | |
|
Re: CGI, and fetching things from the 'address line'
by leocharre (Priest) on Jun 23, 2006 at 14:29 UTC |