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

RewriteEngine on RewriteRule email_member/$ ?rm=email_member SetHandler perl-script PerlHandler SuperClan::Application::Email->handler

Yours
Barry Carlyon barry@barrycarlyon.co.uk

In reply to CGI, and fetching things from the 'address line' by barrycarlyon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.